Hi All,

I am developing WML application using struts2 and tiles on weblogic server
10. 
Struts2 version: 2.0.11

I am facing 2 problems:

1. I am generating a url to the external site using <s:a> and <s:url> as
follows:
<s:url id="externlaURL" value="http://localhost:8080/test"; encode="true">
 <s:param name="returnURL" value='%{request.getHeader("Referer")}" />
</s:url>
<s:a id="Go" href="%{externalURL}" > Go to Another Application Server page
</s:a>

Basically, I want to go to external site running on another app server and
appending returnURL parameter which will be used on the exernal site to come
back to this web application page running on different server.

e.g returnURL contains: http://localhost:7001/demo/index.action?id=123

so the expected URL generation is:
http://localhost:8080/test?returnURL=http://localhost:7001/demo/index.action?id=123

But when i am checking the page source, it shows the %20D, %20F which means
its converting the : / & character exist in returnURL parameter value. 

Please give your suggesstion to resolve this problem.

2. The situation is like same as above problem as follows:

Web App1 - Page 1 - Go Link points to Page 2 with returnURL parameter points
to "Referer" value.
Web App2 - Page 2 - Go back link points to value of return URL i.e. Page 1

Both Web App1 and 2 are running on different server.

Page 1 has the link generation code mentioned in the problem 1. When i click
on 'Go to Another Application Server page ' link, it takes me successfully
to Page 2. Now, i am clicking on Go back link which contains href property
set to returnURL parameter value to come back to Page 1.

Problem is that when i am coming back to page 1 from page 2, its errors out.
But error goes offf if i hit refresh or opens this page in a new window. So,
is it due to switching context between 2 web server in the same browser
window or what?

~Gurpreet Singh



Arup Francis wrote:
> 
> Hi,
> 
>    I am trying to identify whether a button has been clicked or not in my
> jsp.
> The way I do this or is trying to do this is to access the request object
> and then check in that for the button name. The code is as shown below
> 
> The button which was clicked is coded as shown below
> <s:submit value="Continue" action="InitAction_stub" type="image"
> title="Continue" />
> 
> The piece of code where I am trying to check for the button in the jsp 
> <s:if test="#request['action:InitAction_stub.x'] != null">
>       HI
>       <s:set name="abc.currentDisplaySection" value="%{'All'}" />
>       <% request.setAttribute("currentSection","All"); %>
> </s:if>
> <s:else>
>       <% request.setAttribute("currentSection","no"); %>
> </s:else>
> 
> Now I know that the parameter "action:InitAction_stub.x" is present in the
> request Map as I can see that in the Action class which later forwards to
> the jsp. But I am unable to access it in the jsp.
> 
> Is the way I am trying to access the request parameter wrong?
> If so how do I get a request parameter in the jsp - I saw the following
> usage in one of the struts2 pages 
> 
> <s:property value="#request['action:InitAction_stub.x']"/> this shud
> ideally print out the value of the button or any other request parameter.
> But nothing gets printed. So where am I going wrong and what do I need to
> do?
> 
> Also along with this is there any way I can do the below without using
> scriptlets 
> <% request.setAttribute("currentSection","All"); %>
> 
> Also say I have an object in my action class will I be able to rewrite the
> value of that object by using the set statement i.e. will <s:set
> name="abc.currentDisplaySection" value="%{'All'}" /> where abc is an
> object which is specified in the action class and has getters and setters.
> My doubt is whether the above statement will update the
> currentDisplaySection variable under abc object?? so that if I say print
> out the value later using a <s:property
> value="abc.currentDisplaySection"/> it shud print out 'All". Will this
> work??
> 
> 
> TIA,
> Arup
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-access-request---session-objects-in-jsp-using-struts2-tags-tp12407850p19682977.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to