Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to redirect the url

Posted on 2009-04-25
7
Medium Priority
?
290 Views
Last Modified: 2013-11-24
Hi,
 I have following application URL (say url1) which the user enter in browser like
http://localhost:9080/xyz/testapp

I need to redirect it to following  url ( say url2) to bring up the application
http://localhost:9080/xyz/testapp/testapp.do

How can i redirect the url1 to url2 with minimum code change. Ours is struts application.  Any links, resources, ideas, sample code highly appreciated. Thanks in advance.


0
Comment
Question by:gudii9
7 Comments
 
LVL 40

Assisted Solution

by:Richard Quadling
Richard Quadling earned 400 total points
ID: 24233793
Can you use a mod_rewrite rule to get the webserver to do this for you?
0
 
LVL 12

Assisted Solution

by:basav_com
basav_com earned 400 total points
ID: 24234377
0
 
LVL 2

Accepted Solution

by:
itzy earned 600 total points
ID: 24234394
Hi
In your WEB-INF/web.xml
<welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

In you index.jsp
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html>
 <body>
  <logic:forward name="test"/>
  </body>
</html>

and in the file struts-config.xml

<global-forwards>
      <forward name="test" path="/testapp.do" />
</global-forwards>



0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 92

Expert Comment

by:objects
ID: 24234804
a rewrite rule will do that for you

0
 
LVL 7

Author Comment

by:gudii9
ID: 24331297
how to write rewrite rule? is that is same as mod_rewrite rule done by webserver? Please advise
0
 
LVL 92

Assisted Solution

by:objects
objects earned 600 total points
ID: 24332507
0
 
LVL 7

Author Closing Comment

by:gudii9
ID: 31574576
Thank you very much
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question