wood burning stoves 2.0*
The moose likes Struts and the fly likes struts url problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts url problem" Watch "struts url problem" New topic

struts url problem

Emrah Bektas

Joined: Jan 19, 2010
Posts: 3
I try to paging with struts2.
In order to do this,I have to get current action url,then add parameter to this (for ex. www.test.com/test.action)...

The problem is on the current URL.
I get URL in Action class
actionURL = request.getServletPath(); or actionURL = request.getRequestURL()
if (request.getQueryString() != null) {
actionURL += "?" + request.getQueryString();

// this is "/test.action"

then in JSP

<s:set name="actionx" value="actionURL" scope="action"/>

<s:url id="linkx" action="%{actionx}" namespace="">
<s:param name="page" value="#stat.count"></s:param>

<s:a href="%{linkx}"><font color="red" size="4"><s:property value="#stat.count"/></font></s:a> but this anchor href is seen in page = http://test.action?page=1

I add "www.test.com" statically at the head of anchor href but in this case anchor href is seen in page = http://www.test.com/www.test.com/test.action?page=1

I wsant to see http://www.test.com/test.action?page=1
How can I do?
wood burning stoves
subject: struts url problem
Similar Threads
strukts 2 post parameter
Struts 2 s:url and s:param tag question
Pass parameters to Model from anchor tag
> expected error in JSP (struts 2)
passing form parameters such us textfield values using url tag