You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ajay brar <aj...@hotmail.com> on 2003/10/09 06:33:50 UTC

action class for more than one mapping

hi!
can i have an Action class for more than one action mapping.
that is can i do
<action-mappings>

	  <action	path="/menu"
		  type="MenuAction"
		  scope="request">
		<forward name="success" path="/tour.htm" />
	</action>
	  <action	path="/tour"
		  type="MenuAction"
		  scope="request">
		<forward name="success" path="/tour.htm" />
	</action>

  </action-mappings>
if i can have that, then why isn't it working. i have in my index.jsp
<html:link page="/menu.do"> menu </html:link><br>
<html:link page="/tour.do"> tour </html:link><br>
the first link 'menu' works fine, however for the second link, 'tour' i get 
a HTTP 300 multiple choices error.

thanks
ajay

_________________________________________________________________
E-mail just got a whole lot better. New ninemsn Premium. Click here 
http://ninemsn.com.au/premium/landing.asp


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


Determining if Values Have Changed - Or Does it Even Matter?

Posted by Mike Duffy <md...@yahoo.com>.
Example:  

A data entry tech request a customer profile.

The system gets a CustomerProfile business model object from the data access layer.

The CustomerProfile business model is debriefed into a CutomerProfileForm ActionForm object.

The values from the CutomerProfileForm are displayed in text fields through customeProfile.jsp.

A data entry tech checks the data on the screen against a paper copy and determines that
everything is correct.

Nothing has changed so the database does not need to be updated. 

We could add a special button or a checkbox for "No Changes", but we want to keep the data entry
process as simple as possible.  We could hold onto the original copy of CustomerProfile or
CustomerProfileForm and compare for changes.  Or we could just send an update even when nothing
changes (i.e., it doesn't matter if something changes).

I just have a feeling that there is a more elegant way to do this.  Any suggestions?

Thx.

Mike

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


Re: action class for more than one mapping

Posted by "Michael D. Norman" <mi...@probusoft.com>.
Ajay,

Yes, you can definitely have multiple action mappings defined for a
particular action class.  The snippet of struts-config.xml you give below
appears correct, as do the html:link tags on the page.

I would try a few things:

A) Make sure the URL that is getting written to the browser is reasonable.
It should be, but double-check.  That will remove any doubts about the
html:link tags.

B) Find out what happens if you change the action path for /tour.  If it
fixes your problem there is something else mapped to xxx/tour.do, either in
your web.xml or in your server configuration (are you in the default context
and there is another web application defined at /tour?).

C) Finally, if the logic is different inside MenuAction for "/menu" vs.
"/tour", make sure the logic isn't causing the problem, (e.g. is it
forwarding to somewhere else that has a potential duplicate context issue as
described above?)  Also, check out your app server or web server logs and
find out what resource is actually giving the 300 server error.

It would help to know what application server you're running, as well as the
version of Struts.

-- Michael D. Norman
   ProbuSoft - Custom Software Development
   http://www.probusoft.com/
   913-390-6951
   michael@probusoft.com

----- Original Message ----- 
From: "ajay brar" <aj...@hotmail.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, October 08, 2003 11:33 PM
Subject: action class for more than one mapping


> hi!
> can i have an Action class for more than one action mapping.
> that is can i do
> <action-mappings>
>
>   <action path="/menu"
>   type="MenuAction"
>   scope="request">
> <forward name="success" path="/tour.htm" />
> </action>
>   <action path="/tour"
>   type="MenuAction"
>   scope="request">
> <forward name="success" path="/tour.htm" />
> </action>
>
>   </action-mappings>
> if i can have that, then why isn't it working. i have in my index.jsp
> <html:link page="/menu.do"> menu </html:link><br>
> <html:link page="/tour.do"> tour </html:link><br>
> the first link 'menu' works fine, however for the second link, 'tour' i
get
> a HTTP 300 multiple choices error.
>
> thanks
> ajay
>
> _________________________________________________________________
> E-mail just got a whole lot better. New ninemsn Premium. Click here
> http://ninemsn.com.au/premium/landing.asp
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>



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