At this time, the current ActionMapping is not exposed to the JSP, so it
really can't tell which ActionMapping was used to call it. (Though, it
would be cool they could;-)

You might want to route control first through an Action, and then to the
JSP. This way you can put something in the request context to help write
the control. Right now, the simplest thing would be to put two copies of
the button in your JSP, enclosed within logic:equal tags. The tags could
then check to see if they should write the button for TheFirstAction or
TheSecondAction. 

+ Action inserts "fire" bean into rquest context
+ Forward to JSP
+ JSP checks to see if fire==first. If so, write TheFirstAction button
+ JSP checks to see if fire==second. If so, write TheSecondActon button 

-Ted.


[EMAIL PROTECTED] wrote:
> 
> Hello,
> does anyone have an idea, how to use the same physical jsp page in different
> action mappings (with different actions).
> I do not see a way to describe that my action path should be a locigal path
> using a page, which does not fit to
> the pathname of the page.
> 
> Example:
>         JSP is page1.jsp with one button
>         if I call this page as /page1 it should fire TheFirstAction,
>         if I call this page as /page2 it should fire TheSecondAction
>         But which parameter in the action mapping gives me a possibilty to declare
> that page1.jsp
>         should be found as page1.jsp AND as page2.jsp?
> 
> <action-mappings>
>         <action path="/page1"
>                 type="TheFirstAction"
>                 name="Page1Form"
>                 NOTKNOWNATTRIBUTE="page1.jsp"
>                 <forward name="success" path="/page3.jsp"/>
>         </action>
> 
>         <action path="/page2"
>                 type="TheSecondAction"
>                 name="Page1Form"
>                 NOTKNOWNATTRIBUTE="page1.jsp"
>                 <forward name="success" path="/page4.jsp"/>
>         </action>
> <action-mappings>
> 
> The problem is: why must the action-Attribute path be equivalent to the name
> of the jsp?
> 
> If anyone has understood what I am looking for, I would be very happy and
> thankful for help....
> 
> Peter

Reply via email to