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

The Archive Base Latest Questions

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

In Expression Language, I can access my model like so: ${model.member} How do I

  • 0

In Expression Language, I can access my model like so: ${model.member}
How do I achieve the same thing when I want to use <%=some_method(${model.member}); %>

The reason is because I have some HTML helper methods I created to separate logic from UI, and I need to pass a member of the model to create the user control.

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

    The JSP’s main method has the following signature:

            _jspService(HttpServletRequest request,
                        HttpServletResponse response)
                 throws ServletException, java.io.IOException
    

    Based on this, you can access the request and response objects programattically from a scriptlet. For example:

            <%= request.getParameter("foo").toString() %>
    

    or

            <%= request.getAttribute("bar").toString() %>
    

    If you want to do something more complication, you could precede these with scriptlets to declare / initialize local (Java) variables; e.g.

            <% String foo = request.getParameter("foo") == null ?
                       "no foo" : request.getParameter("foo").toString(); %>
    
            <%= foo %>
    

    You can use this to lookup your model in the request or response object (I think it will be an attribute of the request with name “model”), cast it to the appropriate type, and call its getter methods.


    The reason is because I have some HTML helper methods I created to separate logic from UI, and I need to pass a member of the model to create the user control.

    A better idea would be to turn those helper methods into custom JSP tags so that you can use them without resorting to scriptlets. JSPs with embedded scriptlets are generally thought to be hard to read and hard to maintain. One small mistake (or one change to the model API) and the JSP generates bad Java on your deployment platform and you get a broken page.

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

Sidebar

Related Questions

Which regular expression can I use to match (allow) any kind of letter from
I am a bit confused on the type of expression we can use with
what will be corresponding expression language statement for request.getRemoteUser() ?
Is there a way to have Expression Language (EL) expressions included JavaScript files be
What is the regular expression for the language 0 m 1 n where m+n
Now I've heard the expression maths is the language if the universe; and most
How can I convert some regular language to its equivalent Context Free Grammar? Is
Ok, here again. I'll promise to study deeply the regular expression soon :P Language:
Can anyone give me a clue, how to create/call function regular expression syntax in
I am building a conditional formatting feature, where the user can enter an expression

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.