DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Java
Reload this Page invoking a dynamic URL from struts2 action class
Notices
View Poll Results: Is my approach correct
Yes 0 0%
No there are better alternatives to this 0 0%
It can't be done 0 0%
No idea 0 0%
Multiple Choice Poll. Voters: 0. You may not vote on this poll

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Mar 2009
Question invoking a dynamic URL from struts2 action class - 03-08-2009, 02:41 PM

Hi I haven't used Struts2 before and I am working on an assignment in which my application needs to call and external web app.

For that I am using struts2 and I am not sure how to invoke a dynamically generated URL from a struts2 action class.

Because this URL is formed based on the dynamic values which I get using external web services

My web service returns me the user id and user name which i need to populate the below mentioned URL
eg.
user id userName
12345 marc
67890 john


URL = http://ExtApp:ExtApp/WebApp/ext_request.html?action=requestResource&userId=12345&userName=marc

URL = http://ExtApp:ExtApp/WebApp/ext_request.html?action=requestResource&userId=67890&userName=john

The blue part of this URL is also dynamically retrieved by a web service.

This URL needs to be shown as a hyperlink on my web application which points to my ExternalApp.

I am clue less how I can use struts2 in order to do that.

please send your inputs asap.
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Join Date: Mar 2009
Default 03-18-2009, 10:54 PM

You can save the URL in request scope,using request.setAttribute("DynaURL",URL) .
And then in JSP pages,use <html:link> tag to represent the URL. For more information of <html:link> tag, please consult Struts's documentation
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Join Date: Mar 2009
Default reply - 03-18-2009, 10:56 PM

You can save the URL in request scope,using request.setAttribute("DynaURL",URL) in execute() method .
And then in JSP pages,use <html:link> tag to represent the URL. For more information about <html:link> tag, please consult Struts's documentation.
Reply With Quote
Reply

Tags
integration, struts2, web services, webapp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem while invoking web service through code ashu47202 Java 4 10-09-2009 12:57 PM
I want to create action class to generate server wizard. prashantpathak@hsbc.co.in Eclipse 0 11-19-2008 07:43 AM
Want to create a cheat sheet action class. prashantpathak@hsbc.co.in Eclipse 0 11-19-2008 07:33 AM
how to implement JSTL tags in struts2.0.12 anisha196 Java 0 11-14-2008 08:53 AM
how to disable an action on some other action sandeepp Eclipse 0 08-28-2008 06:29 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com