This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Request url forwarding 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 "Request url forwarding" Watch "Request url forwarding" New topic

Request url forwarding

Prasath Premkumar
Ranch Hand

Joined: Nov 13, 2008
Posts: 43


I have to change the request url and forward it. For example i need to change all "/aaa/bbb/ccc/..." urls as "/aaa/ccc/..." ("/bbb" removed
from request url)and forward it. How can i do it without response.redirect in servlet ???

Can i do it with Struts 1???

Thanks in advance.
Jaimesh M Ponkia

Joined: Nov 24, 2010
Posts: 21
I am not sure if I understand the problem correctly, let me try to rephrase it.
1. You are currently on page which has URL as "/aaa/bbb/ccc/"
2. On click of a button or link you want to forward it some other URL/Action.

If this is the case then yes you can do it using struts. You can use ForwardAction for the same.

Just wondering why are you worried about what is the current page URL?
I agree. Here's the link:
subject: Request url forwarding
Similar Threads
javascript funtion needed for given html option/combo box
Arrays of strings from a Vector
string manipulation
How to split a string by the whitespace but ignoring '\n'?