• 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

redirect to an URL by POST.

 
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

Want to redirect to another URL and having a single parameter using POST. how do i go about it....
'm using struts2 framework.

my URL is "http://server:port/apps/token=dufiidlcoodllsdkfficiidn"

also it would be really helpful if anybody gives me the action mapping in struts.xml, after i do the logic in an action class, how to redirect after POST.

Thanks in advance.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Robin John wrote:hi all,

Want to redirect to another URL and having a single parameter using POST. how do i go about it....
'm using struts2 framework.

my URL is "http://server:port/apps/token=dufiidlcoodllsdkfficiidn"

also it would be really helpful if anybody gives me the action mapping in struts.xml, after i do the logic in an action class, how to redirect after POST.

Thanks in advance.




hi
try doing a find forward on the request
like request.findForwrd("ur defined path");
you can rediect the request to a different jsp.

and action mapping you can do in the following way

<!-- ========== Action Mapping Definitions ======== -->
<action-mappings>
<action
path="/login"
type="test.struts.LoginAction" >

<forward name="valid" path="/jsp/MainMenu.jsp" />
<forward name="invalid" path="/jsp/LoginView.jsp" />
</action>
</action-mappings>

you can go to the http://struts.apache.org/ following site ... it is very userfriedly and you will get lot of examples.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Pragna: Struts 2, not Struts 1.

The easiest way to do it is to include the parameter in your result configuration, similar to the following:



Your action would have a "token" property with a getter.

See result configuration and parameters in configuration results for more details.
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks david,

actually i have to redirect from one application to another and pass the token to the 2nd application, and i need to hide it from the URL, because when i used the action mapping it still comes in the URL but i dont want that. so how do i hide the token parameter from being visible in the URL.

regards.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In general you don't--you're talking across separate applications, so you need to send all the information in the URL.
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks David for clearing this out,

now i can reply the designers that we "CANT"

YiPEEEEEEE.
 
reply
    Bookmark Topic Watch Topic
  • New Topic