Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7031357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:47:34+00:00 2026-05-28T00:47:34+00:00

Other then putting a comment or a hidden variable as part of own JSP

  • 0

Other then putting a comment or a hidden variable as part of own JSP page, is it possible programmatically to find out what it is?

If so, how can I reference own file name inside JSP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:47:35+00:00Added an answer on May 28, 2026 at 12:47 am

    You can use

    ${pageContext.request.servletPath}
    

    to obtain the part of the request/forward URI which matched the JspServlet. This works regardless of if the JSP is been requested standalone or been forwarded by a front controller servlet.

    In JSP files which are been included by another JSP, instead use

    ${requestScope['javax.servlet.include.servlet_path']}
    

    You can’t really obtain the JSP original file name in any way as it’s been generated to a servlet class. You can however obtain the (simple) class name of the generated servlet class as follows:

    ${pageContext.page['class'].simpleName}
    

    When using Jasper as JSP compiler (as is been used in Tomcat and clones), this defaults to filename_jsp (with underscore instead of period). This may or may not be sufficient as it tight-couples the code to a specific container.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to create merged cells in SlickGrid? If not, then what other
I know, nobr tag is deprecated, then how can i do this with other
Other then setting UIGestureRecognizers in a Controller: UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:v action:@selector(handleSwipe:)];
I have a large program that is working other then one .h file that
Is there a way to alter/create tables in built in air database, other then
The app will run fine, then crash - literally every other time. It seems
I opened up Business Intelligence Design Studio (BIDS) the other day. Since then my
Other than using the Column chart and naming appropriately is it possible to create
I know i will be shouted out for putting logic into the view but
I have a web application where users can create topics and also comment on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.