Solved

Path Error

Posted on 2006-06-08
1
193 Views
Last Modified: 2010-03-31
hi experts,

Simple but wired error related to path. I'm using JSP/Servlet/Struts. Here is the code.
==============
delegate.jsp
...
<a href="action123.jsp">ADD</a>
...
--------------------------
action123.jsp
=========
<form action="/Home/DoIt.do" ..>
..
</form>

=========
Servlet
....
String Delegate = Failure; (default making to failure)
....
Delegate=Success;
...
return (mapping.findForward(Delegate));
..
===============
Struts-config.xml
..
      <action path="/DoIt" type="com.admin.Delegation">
            <forward name="Success" path="/delegation/delegate.jsp"/>
      <forward name="Failed" path="/Error.jsp"/>
      </action>
=========

My DIR structure:
Root:
 <Home>: Error.jsp, etc.,....
  <delegation>:delegate.jsp, action123.jsp etc.,

NOW THE PROBLEM I'M HAVING:
After executing the action123 which calls Servlet and finally fwd to /delegation/delegate.jsp. It is showing delegate.jsp page.
But the when I click to add more stuff to <ADD> link its refering to <a href="/Home/action123.jsp"> which is false. In real it hs to refer to "/delegation/action123.jsp"

Where do I need to change or add path stuff ??

Thx,
PH


0
Comment
Question by:princehyderabad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 92

Accepted Solution

by:
objects earned 125 total points
ID: 16865733
either specify the absolute path, or
use base tag to specify base url for page

http://www.w3schools.com/tags/tag_base.asp
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
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:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

691 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