• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Links on the page and Actions

 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All -

Here is my application flow :

Category Selection Screen (action=submitCagetoryForm.do) takes to Parameter Selection Screen

Parameter Selection Screen (action=submitParameterSelectionForm.do) takes to
Report screen

In Report screen I need to have links to
- Category Selection Screen
- Parameter Selection Screen

Do I need to create 2 separate actions in struts-config.xml to handle these 2 links ?

Really appreciate any suggestions.

Thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is generally a good idea to create a separate action that simply displays a page. For example, you really can't use the action submitCagetoryForm to display the ParameterSelection JSP because that action is expecting to process input from another form.

While it is possible to simply create a link to the JSP itself, it's not considered best practice. Best practice is to hide all of your JSPs behind an action. Besides, usually there is some type of processing necessary before displaying a page such as pre-populating values or filling options in drop-down boxes.

If there is no processing needed to display a page, you can use a "forward action mapping". This type of action mapping doesn't use an Action class, but just forwards to the JSP. Example:

<action name="myForm" path="/myForwardAction" forward="/myPage.jsp" />
 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to call the .do from HREF and it looks like the app didn't like it.

(a href='/APP/LinkToReportSelection.do')

I'm getting error message

type : Status report

message : Invalid path /LinkToReportSelection was requested

description : The request sent by the client was syntactically incorrect (Invalid path /LinkToReportSelection was requested).

I really appreciate any suggestions.

Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The most likely explanation for this is a spelling error.

Please show us the action mapping for this action in your struts-config.xml file. Also, is /APP the context root for your application?
 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right. I found the mistake.
Thanks much.
reply
    Bookmark Topic Watch Topic
  • New Topic