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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:16:12+00:00 2026-05-26T17:16:12+00:00

I have a application which allows user to make a search. Based on the

  • 0

I have a application which allows user to make a search.

Based on the search criteria entered, a service call to DAO function is made (pattern jsp event -> interceptors -> processors -> services -> DAO -> database) and list of results is returned back which gets displayed in myView.jsp

Code as below is used to read the TO data in JSP:

<jsp:usebean id="myTO" type="com.myPackage.MyTO" scope="session"/>

and in the body something like

<%= myTo.getSomething() =%>

Each item on the list is clickable for details. So on clicking item 2 on the list, another call will be made with item 2’s id to fetch more details on item 2.

Depending on type of item, the details are fetched in different TO’s. e.g. Type1TO, Type2TO.

So detailed data on item is returned in one such TO.

Issue is: I am displaying the details in the same JSP. So the returnURL of the second request gets forwarded to myView.JSP

So I have put a line like

<jsp:usebean id="type1TO" type="com.myPackage.Type1TO" scope="session"/>

However this gives error during the first call of list search when above Type1TO does not yet exist. Error is something like “unable to find type1TO in scope session”

How could I solve this issue ???

Is there a way to put jsp:usebean tag in an if condition in the place where it is to be used in the body ?? Or any other solution to this ??

I am new to JSP and dealing with legacy JSP. So very advanced JSP (complex EL) might not be feasible.

  • 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-26T17:16:12+00:00Added an answer on May 26, 2026 at 5:16 pm

    The following are the usages of the <usebean>:

    1. <jsp:useBean id=”connection” class=”com.myco.myapp.Connection” /> . In this example the bean with the id is made available either by creating or finding the existing one in the session
    2. <jsp:useBean id=”connection” class=”com.myco.myapp.Connection”>
      <jsp:setProperty name=”connection” property=”timeout” value=”33”>
      </jsp:useBean>
      . In this example, the bean is created or found, and instatiated with the setProperty if it is being created.
    3. <jsp:useBean id=”wombat” type=”my.WombatType” scope=”session”/>. In this example the existing bean is found and made available with the given type.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on an application which allows the user to make a
I have a NSDocument based application, which allows the user to send messages, after
I have made one custom user control (search text box), which basically consists of
I have a web application (Java, Websphere, JSP) which allows co-workers to register visitors
I have written an application that allows a user to define a query, run
I have a Django application which allows different kinds of users: firms, administrators, external
I currently have a web based application which strictly relies on a 3rd party
I have an app which allows user to import media (videos, photos, audio) which
I develop an application, which allows user to choose wallpaper from gallery and set
I have an application which is a portal application and I want to allow

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.