• 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

struts - how to solve problem of URL parameter?

 
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, good day , i have a question on struts ..i have an action , which after completed process will then forward to a page which contain multiple form in a page(tabbed form), in order to display correct form to user , i might need some URL parameters to help select the correct form, it will however look like '/WEB-INF/results/result1.jsp?showform=2' as mappingforward..i might also need to have several similar kind of mappingforward for '/WEB-INF/results/result1.jsp?showform=1' , showform=3 ...etc

can someone guide me how to write the forward? i using following way but is not working



or someone guide me the proper way to settle this problem ...thank you very much for your time
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alvin,
Struts forwards aren't really designed to pass data through parameters.

A better approach is to have your action store the value as an attribute in the request:
request.setAttribute("showForm", new Integer(2));

The JSP can then get this value and render the appropriate form.
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, Jeanne Boyarsky ...it really help ..thank you
 
It's just a flesh wound! Or a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic