Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

JSP Filename

Thread view: 
Noodle - 12 Oct 2006 01:24 GMT
How can I print the filename of the page executing in a jsp?

e.g.

http://www.myhost.com/index.jsp
and
http://www.myhost.com/

will print "index.jsp".

Any ideas?
hiwa - 12 Oct 2006 01:46 GMT
> How can I print the filename of the page executing in a jsp?
>
[quoted text clipped - 7 lines]
>
> Any ideas?
Learn about Web application deployment descriptor, a.k.a. web.xml file.
Noodle - 12 Oct 2006 06:26 GMT
> > How can I print the filename of the page executing in a jsp?
> >
[quoted text clipped - 8 lines]
> > Any ideas?
> Learn about Web application deployment descriptor, a.k.a. web.xml file.

Thanks everyone for your replies. I think the safest thing would be to
hard code the file name in as a variable in the page.

hiwa, I fail to see how the deployment desciptor will help me achieve
my goal. Could you please elaborate your idea a little further.
Manish Pandit - 12 Oct 2006 01:59 GMT
<%=request.getRequestURI( )%>

-cheers,
Manish
Arne Vajhøj - 12 Oct 2006 02:18 GMT
> How can I print the filename of the page executing in a jsp?
> e.g.
[quoted text clipped - 6 lines]
>
> Any ideas?

The first one is easy to achieve.

request.getRequestURL()

The second one is much harder.

getClass().getName()

vil give you a server dependent transcription of the name.

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.