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

  • Home
  • SEARCH
  • 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 801011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:22:39+00:00 2026-05-14T23:22:39+00:00

I have HTML code in the jsp page that I want it to be

  • 0

I have HTML code in the jsp page that I want it to be displayed only after the user submits data and get redirected to this page. So I have to set a success flag as a parameter in the link like:

http://site.com/page?success=true

Not sending in the request because it will be lost since I am redirecting
I don’t want to send it in the link as a parameter and I am thinking of another way
and ideas how to send it? So the link will be:

http://site.com/page

and I can display the the html code?

  • 1 1 Answer
  • 1 View
  • 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-14T23:22:40+00:00Added an answer on May 14, 2026 at 11:22 pm

    Just set it as a request attribtue.

    if (/* form is succesfully submitted */) {
        request.setAttribute("success", true);
    }
    request.getRequestDispatcher("page.jsp").forward(request, response);
    

    Use JSTL c:if tag to conditionally render content based on EL expression.

    <c:if test="${success}">
        Your notification here.
    </c:if>
    

    If you want to survive the redirects, then you need to set it as session attribtue instead:

    if (/* form is succesfully submitted */) {
        request.getSession().setAttribute("success", true);
    }
    response.sendRedirect("page.jsp");
    

    Use c:remove remove it after first display so that the subsequent requests won’t be affected:

    <c:if test="${success}">
        <c:remove var="success" scope="session" />
        Your notification here.
    </c:if>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jsp page that is trying to reference some user defined classes.
I want to generate some html code for the jsf page I have (I
I have html code that looks roughly like this: <div id=id1> <div id=id2> <p>some
I have the following html.erb code that I'm looking to move to Haml: <span
I have a submit button that is a block of HTML code because of
I have a HTML file that has code similar to the following. <table> <tr>
I have an HTML textbox that contains some SQL code that I need executed.
I have some static html content (included on a dynamically generated page) that I
I have custom JSP tags that generate some HTML content, along with some javascript
I have a JSP page running in Tomcat that is not rendering properly. Here

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.