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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:00:29+00:00 2026-05-29T15:00:29+00:00

I know HTML is not a programming language and so applying Object Oriented principles

  • 0

I know HTML is not a programming language and so applying Object Oriented principles is not possible, but, I have an annoying issue which would be simply solved if you could have a form tag inheriting from a parent form tag.

I want to split my JSP page up into logical form includes for various reasons, but mainly to aid the compartmentalisation of client side data input and associated server side handling in order to promote re-use of code. However, there is one common, page scope value which I require to be submitted along with each, individual form submit.

I could duplicate this one input within each form but it seems crazy to have the same value duplicated several times on a page. A javascript “onsubmit” function could also be the answer but that is useless when javascript is turned off. I could also have a session scope variable in my java storing the value but I’d rather avoid that.

Any ideas other than sucking up the code duplication on the 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-29T15:00:30+00:00Added an answer on May 29, 2026 at 3:00 pm

    If you have individual forms on the page, then yes, you’ll have to duplicate the common piece of data in all of those forms; there’s no way to “inherit” it without using JavaScript on the client.

    If it’s hidden information (and it sounds like it is), you can include in each form’s action attribute, and so your JSP code can make the duplication fairly innocuous:

    <%
        // (Be sure to URL-encode the value if necessary, not shown here)
        String formAction = response.encodeURL("action.jsp?hiddenData=" + hiddenValue);
    %>
    ...
    <form action="<%=formAction%>">
    ...
    </form>
    ...
    <form action="<%=formAction%>">
    ...
    </form>
    ...
    

    Alternately you can include a hidden field in each form, again by doing it once in the JSP code and then dumping it out on each form.

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

Sidebar

Related Questions

Not really a programming question, but relevant to many programmers... Let's say I have
I know there are HTML entities for 1/2, 1/4, and 3/4, but are there
I know that I should put all the html elements in body tag, but
I know that a submit button in HTML can submit a form which opens
I have got a html web page which gets a user input in the
I know this is the most common problem in the history of programming but
i have used the login script which is found here http://www.phpeasystep.com/phptu/6.html the script works
I know a bit of javascript, HTML, CSS, VBA and just general programming structures
I'd like to know good strategies for deploying a domain-specific-language which must run under
Hey I know I been asking alot of questions.. but not much resources 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.