facebook

jst and jsp problem with double bracket [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #205310 Reply

    arnor
    Member

    Hi to the list,

    My system:

    Version: 3.0.0
    Build id: 200402122000

    myeclipse:
    Version: 3.7.0
    Build id: 20040305-3.7.0

    java sdk:
    jdk1.3.1_09 or j2re1.4.2_02

    so:
    winXp

    Witj jstl -rt tag and jsp script I get an error with no feedback.

    example:
    <c-rt:set var=”srv_cryptPswd” value=”<%=Crypt.sha1((String)pageContext.findAttribute(“srv_Pswd”) +

    (String)session.getAttribute(“challenge”))%>” />

    The problem is double brachet. With single brachet all work fine.

    Is it a now bug? I read about a similar problem here:
    https://www.genuitec.com/forums/topic/tag-attribute-of-lt-string-messes-up-coloring-closed/

    thanks in advance

    Lorenzo

    #205317 Reply

    Riyad Kalla
    Member

    Lorenzo,
    I believe your problem is actually not escaping the double quotes inside of the expression, try this:

    
    <c-rt:set var="srv_cryptPswd" value="<%=Crypt.sha1((String)pageContext.findAttribute(\"srv_Pswd\") + (String)session.getAttribute(\"challenge\"))%>" />
    
    #205318 Reply

    arnor
    Member

    right, it work.
    is it a bug or the right way is with quote?

    Regards Lorenzo

    #205323 Reply

    Scott Anderson
    Participant

    You can either quote, or use single quotes to go around the entire attribute like this:

    
    <c-rt:set var="srv_cryptPswd" value='<%=Crypt.sha1((String)pageContext.findAttribute("srv_Pswd") + (String)session.getAttribute("challenge"))%>' /> 
    
    #205324 Reply

    No Operation
    Member

    Let me try to answer this, since it depends on the defined taglibs

    a) there is a taglib with prefix “c-rt”

    "<%= ... %>"

    is a runtime-attribute-value.
    The quoting is required, to conform the JSP specification.

    b) there is no taglib with prefix “c-rt”

    <%= ... %>

    is an expression, plain Java syntax is required.
    There must be no quoting.


    Well, there is no reason, why the spec was made like this. But spec is spec.

    NOP

    #205326 Reply

    Scott Anderson
    Participant

    Wow. Thanks for the clarification. 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: jst and jsp problem with double bracket [Closed]

You must be logged in to post in the forum log in