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

The Archive Base Latest Questions

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

Weird question, but i need to find an answer. Is there any way, in

  • 0

Weird question, but i need to find an answer.

Is there any way, in which i can manage managed beans in JSP? I`ll try to explain, what i want to do:

Imagine, i have JSP page, which, for example, is called document.save.jsp. I have some various documents with different types. Each of them have their own bean. For example: BillDocument.java, OrderDocument.java and ReportDocument.java.

BillDocument.java in my jsp is #{billdoc}.
OrderDocument.java -> #{orddoc}.
ReportDocument.java -> #{repdoc}.

Each of them have method save(). In my JSP i want to call this method, but i need to know, which document it is. In my mind this structure is something like:

<% String currentBean = ""; 
if(document == BillDocument){ 
   currentBean = #{billdoc};
}
if(document == OrderDocument){
   currentBean = #{orddoc};
}
if(document = ReportDocument){
   currentBean = #{repdoc};
}
 %>

Then, my Button with save method on it, may be smth like:

<h:commandButton action="currentbean.save"/>

Is there any way, in which i can store data about bean, which will be used in this button?

Thank`s for your replies!

  • 1 1 Answer
  • 2 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-14T01:52:39+00:00Added an answer on May 14, 2026 at 1:52 am

    Why don’t you have a fourth bean which has properties of all the other beans and just calls the relevant method given the document type?

    i.e. DocumentBean.save() will call BillDocument.save() or OrderDocument.save() or… etc.

    Rather than trying to do this in your JSF page.

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

Sidebar

Related Questions

This may sound like a weird question but is there any where I can
My question is somewhat weird, but can i add events for any DOM elements(div),
I know this can seem a weird question but for me it would be
I can't find any question exactly like this. If I'm wrong please point me
This question may sound kinda weird but actually, I need to convince my mangement
Kind of a weird question, but. I need to have a list of strings
This is a weird question but its been driving me bonkers for the last
Weird question, but one that puzzles me a bit. In the old days when
Hi this may seem like a weird question, but here's my situation: I have
This might seem like a weird question, but bear with me. I'd like to

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.