简体   繁体   中英

Struts1 Preety url

<servlet-mapping>
    <servlet-name>action</servlet-name>
    <!--<url-pattern>*.do</url-pattern>-->
    <url-pattern>/</url-pattern>
</servlet-mapping>

I am doing like this to obtain my url seo friendly. Now i am facing a problem is that to my one of my controller i am passing parameter : test1.in as

http://www.myweb.com/manage/test1.in

So in manage action servlet i get the parameter as test1 but not test1.in, can somebody tell me how to do this?

Friends, finally i got solution to this problem is : using request object

String requestUrlTemp = new String(request.getRequestURL());
String requestUrl = "";   
requestUrl= URLDecoder.decode(requestUrlTemp, "UTF-8" );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM