Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Moving A JSP
Moving A JSP [message #252931] Tue, 15 June 2004 18:30 Go to next message
Eclipse UserFriend
Originally posted by: newsgroups.raincode.net

IDE --> Eclipse 2
OS --> any OS

SUMMARY: After you move a JSP in a project, is there any way to update
all
hyperlinks in the project that point at that JSP?

DETAIL: Currently I use:
String context = request.getContextPath();

...at the top of my JSP so that I have all my relative URL's in the rest
of
the JSP are like:

<a href="<%= context %>/someplace/some.jsp">Another JSP</a>

I am trying to keep the links the least hard-coded as possible. But what
if
some.jsp gets moved to directory /otherworld/some.jsp ? How can you
update
this change in the whole project when refactoring won't touch the
hyperlinks
in the JSP's?

I suppose I could write a side-utility to run through all the source and
change things. Is that how everyone else does it? Or, all JSP's could
reside in one directory, but that's kinda messy during development.

Thanks,
Rob
Re: Moving A JSP [message #253711 is a reply to message #252931] Thu, 17 June 2004 13:06 Go to previous message
Eclipse UserFriend
Originally posted by: newsgroups.raincode.net

Robert Mazur wrote:

> IDE --> Eclipse 2
> OS --> any OS

> SUMMARY: After you move a JSP in a project, is there any way to update
> all hyperlinks in the project that point at that JSP?

> DETAIL: Currently I use:
> String context = request.getContextPath();

> ...at the top of my JSP so that I have all my relative URL's in the rest
> of the JSP are like:

> <a href="<%= context %>/someplace/some.jsp">Another JSP</a>

> I am trying to keep the links the least hard-coded as possible. But what
> if some.jsp gets moved to directory /otherworld/some.jsp ? How can you
> update this change in the whole project when refactoring won't touch the
> hyperlinks in the JSP's?

> I suppose I could write a side-utility to run through all the source and
> change things. Is that how everyone else does it? Or, all JSP's could
> reside in one directory, but that's kinda messy during development.

> Thanks,
> Rob

I think I answered my own question.

If you take the time to do all the naming/mapping of the JSP's in the
web.xml of the application, then you never need to worry about where in
the .war or in the OS filesystem the JSP gets moved. You can just change
the proper entries in the web.xml.

Cool. If anyone wants to add an alternate method, please feel free.
Rob
Previous Topic:building Eclipse on MacOSX with GTK?
Next Topic:How to create a Job?
Goto Forum:
  


Current Time: Sat May 10 16:34:28 EDT 2025

Powered by FUDForum. Page generated in 0.02623 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top