struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J, Sadhasivam (Cognizant)" <JSadh...@blr.cognizant.com>
Subject Problem Statement for some standard e-Biz requirmentsf
Date Fri, 06 Jun 2003 13:39:12 GMT
Hi,
	
	Problem Statement
	=================
		As per my understanding towards the struts that it doesn't have the Trigger kind of mechanism
to solve 
	some of the  typical e-Biz scnerios or standard requirments for example

		1. Log all the URIs with some custom format and give to some other serivces
			This has to happen irrespective of regular flow.

		2. Standard channel behaviour in portal. Like Yahoo shows weather/ads etc to a User or User
group. etc.

		Such kind of requirement is very common and not been taken in struts i belive. 

		I have come up with an approach to cater these problems. 
		I did a proof of concept also and i would like to know is its really a good approach 
		or is there any othere standard way to implement this in Struts.

		Hope apache/open source foundation people spent some time to give me 
		an indication whether this approach is correct or not.
		
	Approach Taken
	==============
		Shall call this phenomenon as Hooking
		
		Step 0:	Write a Standard Interface to perform this Hooking 
		======
			public interface ActionHook
			{
				public void prePerform(  HttpServletRequest request );
			}


		Step 1: addition of XML Nodes in struts-config.xml
		======
		Justification
		=============
			Since these problems are pertainting to the problem space and
			 it should be configured at the runtime to pick up these data.

		struts-config.xml 
			<action-hooks>
				<action-hook  name="org.apache.hook.ActionHook" servlet="action"/>
				<action-hook  name="org.apache.hook.ChannelHook" servlet="action"/>
			</action-hooks>
	


		Step 2: Load ActionHook Object through digester.
		======
		Justification
		=============
			Configured classes are loaded by HookRuleBase and HookRule classes as a standard way from
apache.


		Step 3:	Changes in the ActionServlet to process ActionHooks
		======
		Justification
		=============
			Load the ActionHooks Object and process the ActionHooks before even start the form processing.
			
			processHook(ActionMapping mapping, HttpServletRequest request )
			{
				Iterator keySet = hookMap.keySet().iterator();
				
				while( keySet.next() )
				{
					Object key = keySet.get( key );
					ActionHook hook = ( ActionHook )hookMap.get( key );
					hook.prePerform( request) ;
				}
			}

	
		Step 4:	Write a custom ActionHook object to perform this.
		======	
			public class ChannelHook implements ActionHook
			{
			public void prePerform( ActionForward forward, HttpServletRequest request, HttpServletResponse
response )
			{
				// TO DO 
				// Required Busisess Logic and Set the Object Object in the mentioned Scope
			 }
			}
	

		Tnx for the patient reading. About to hear more things from you guys.


regards
sadhas





-----Original Message-----
From: J, Sadhasivam (Cognizant) 
Sent: Wednesday, June 04, 2003 10:25 PM
To: 'struts-user@jakarta.apache.org'
Cc: 'husted@apache.org'; 'andrew.david.hill@gridnode.com'
Subject: RE: Struts redirection problem


The doubt is can implement portal channel kind of behivour where in channels are dropped in
my dynamic contents
and in the content area requalr CRUD operation will be followed.

-----Original Message-----
From: J, Sadhasivam (Cognizant) 
Sent: Wednesday, June 04, 2003 9:22 PM
To: 'Struts Users Mailing List'; 'andrew.david.hill@gridnode.com'
Subject: RE: Struts redirection problem


in the problem statement i have mentioned that we are doing that but its not the right way
to do as per my assumption.
because do the formvalidation if its invalid instead of going to the action.perform redirect
to jsp directly
is the struts thumb rule and design. 

Ideally is it good to over look that and 
hypotheically if the user knows that action then get the view without doing form validation..
i don't think struts will allow this even thought its a good work around.



-----Original Message-----
From: Andrew Hill [mailto:andrew.david.hill@gridnode.com]
Sent: Wednesday, June 04, 2003 9:13 PM
To: Struts Users Mailing List
Subject: RE: Struts redirection problem


Make the input attribute in the mapping point at the action (the one it goes
through before forwarding to that view if its different).


-----Original Message-----
From: J, Sadhasivam (Cognizant) [mailto:JSadhasi@blr.cognizant.com]
Sent: Wednesday, 4 June 2003 23:38
To: struts-user@jakarta.apache.org
Cc: husted@apache.org
Subject: Struts redirection problem


Hi,
	We are doing a portal in which we have a News Channel in the pages across
the site.
assume its just a corner html display area in the Site which frameless site.
with respect to site updation and new arrivals this content should be picked
and display the top 10 records.

	For better control i have wrote a wrapper to the struts action in which
perform method is implemented by having my own abstract method. for more
control i have created postPerform and prePerform event methods which gets
executed before perform.

  Problem statement:
	Since news item should be executed each and every page.
      i have hooked the News Action to postPerform or prePerform and set the
form data in request scope. The problem is
when there is form validation and input attribute is jsp the control won;t
go to the action level and bombs. right now we did most of our validation
are done in form with input attirbute point to action element which is wrong

Is there any way to implement a channel kind of portal behivour in struts ??

	Thx in advance
	sadhasivam.j


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message