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 9017421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:16:11+00:00 2026-06-16T04:16:11+00:00

the thing is I’d like to get the current url in a jsp page,

  • 0

the thing is I’d like to get the current url in a jsp page, but not showing the .jsp page but the action name. For example:

I have the action http://www.mypage.com/Index, which displays the page http://www.mypage.com/pages/index.jsp. Is there any way I could obtain the first Url in a jsp file? What I have always returns the path to the jsp, but what I want is the action name. What I have is:

<%=  (request.getServletPath()) %>

and

${pageContext.request.requestURL}?${pageContext.request.queryString} //to get the id attached

I want this for a simple facebook share button:

<div class="fb-like" data-href="${pageContext.request.requestURL}?${pageContext.request.queryString}" data-send="true" data-width="450" data-show-faces="true"></div>
  • 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-06-16T04:16:13+00:00Added an answer on June 16, 2026 at 4:16 am

    Use <s:url> tag for that.

    <s:url forceAddSchemeHostAndPort="true" includeParams="all"/>
    

    The forceAddSchemeHostAndPort attribute setted to true will add your host name with port and includeParams setted to all will include all parameters to it.

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

Sidebar

Related Questions

Every thing goes in code, but not saving data in SQLite db. Can any
The thing is I have some graphics shown in a form, rectangle for example,
One thing I don't like about writing javascript-based applications is that you have to
One thing I have never used PHP for is on-demand image placement - but
Strange thing – I have Authentication module in lib/ like this: module Authentication protected
some thing like the above image. I have a huge list of data being
First thing I know this is repeated question but I don't have problem in
Thing is: I have a webcrawler framework, and independent modules that implement this framework.
Simple thing I'm doing is connecting to retrieving user's name from Facebook and passing
The thing is that I want to get parameters for my Capistrano recipe from

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.