• 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 url problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
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:url>

<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?
thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic