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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:47:50+00:00 2026-05-30T01:47:50+00:00

I have defined a custom tag to take one parameter, a number, which it

  • 0

I have defined a custom tag to take one parameter, a number, which it then uses to look up some information and return. I keep getting a NumberFormatException though. I am passing the number to the tag in my jsp by use of a EL.

<my:myTag id="${action.id}"/>

In the bean class for Action :

private int id;
private void setId(int id){
this.id = id;
}
private int getId(){
return id;
}

In my custom tag handler :

private int id;
//getters and setters for id
public int doStartTag() throws JSPException {
//Does some stuff with id
}

In my tld (omitted some stuff) :

<attribute>
   <name>id</name>
   <required>true</required>
   <rtexprvalue>true</rtexprvalue>
</attribute>

The tag does what I want it to if I just pass a number in (ie, id=”6″) but always throws the exception when I try to use the EL expression value. Is there some int-string conversion happening somewhere when the expression is evaluated or something? It is an int field in the bean and I assumed it would just get passed through as such? I have tried changing the attribute of my tag handler to String and Integer and neither have resolved this. I have set rtexprvalue to true so it should be evaluating it fine. Any help appreciated.

  • 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-30T01:47:51+00:00Added an answer on May 30, 2026 at 1:47 am

    OK, this is the longer version of my comment above…

    In JSP 1.x, the JSP engine did not know anything about the expression language. The EL was defined as part of JSTL, but it was built in to the tags themselves, the engine didn’t get involved in the evaluation.

    In JSP 2.0, the EL was moved into the JSP spec, and the engine supports it. In JSP 2.1, the EL was merged with the JSF EL.

    So, if you’re using JSP 1.x, then you have to do the EL yourself.

    But, just to make things more complicated, in JSP 2.0 the API for customer tag handlers was simplified. In JSP 1.x, tags implemented Tag, but in JSP 2.0 tags implement SimpleTag.

    A JSP 2.x engine will support JSP 1.x style tags (classes implementing Tag) but will treat them in the same way that JSP 1.x treated them – the EL is not evaluated by the engine, and the tag will need to explicitly evaluate it.

    As for rtexprvalue, this actually controls whether a scriptlet expression is supported, and not whether an EL expression is supported (that attribute pre-dates the EL).

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

Sidebar

Related Questions

When trying to use a custom JSP tag library, I have a variable defined
I have defined a custom ListViewItem contorl in XAML, which we'll call Item.xaml. These
I have defined 2 custom routes. One for threads/:id/:name and the other for threads/tags/:tagName
I have defined a custom Sharepoint list for special attributes related to a software
I have defined a custom list template type for SharePoint . I install it
I have defined a custom IPrincipal and custom IIdentity based on a website that
I have defined a custom file type with these lines: syn region SubSubtitle start=+=+
I've defined a custom content type - news. I also have a menu item
Is it possible to have scoped macros using custom defined macros through boost wave?
I have an custom binding defined as follows: <customBinding> <binding name=binaryHttpBinding> <binaryMessageEncoding /> <httpTransport

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.