Results 1 to 3 of 3
  1. #1
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default retrieve request attribute in jsp using el.

    Hi ,

    I'm trying to retrieve the value from a request attribute in a jsp page. Servlet is setting the request attribute as following

    Java Code:
    request.setAttribute("name", value);
    RequestDispatcher reqDesp = request.getRequestDispatcher(a.jsp);
        reqDesp.forward(request, response);
    then i'm trying to access this attribute from a jsp (b.jsp) page which has been included as part of another jsp.

    In a.jsp file

    Java Code:
    <jsp:include flush="true" page="b.jsp"/>
    when i'm trying to access the request attribute from b.jsp using el it won't run properly. But if i use scriplets it's running perfectly.

    This works well
    Java Code:
    <%=request.getAttribute("name") %>
    but this won't work,
    Java Code:
    ${requestScope.name}

    Can someone explain me why el is not working properly ?

  2. #2
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default Re: retrieve request attribute in jsp using el.

    anyone please help me, i'm stuck here..

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: retrieve request attribute in jsp using el.

    Where is requestScope declared?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 2
    Last Post: 03-29-2012, 10:32 AM
  2. Replies: 0
    Last Post: 07-06-2011, 01:12 PM
  3. Replies: 0
    Last Post: 03-10-2010, 02:52 PM
  4. Errors come when i set attribute in request in Action Form
    By 82rathi.angara in forum New To Java
    Replies: 3
    Last Post: 09-22-2008, 02:05 PM
  5. Request attribute PageBean = null
    By Nick15 in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 05-17-2007, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •