Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

JSTL: Using c:if to test boolean after a login

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having a little difficulty getting the c:if tag working.

The error that im getting is javax.servlet.jsp.el.ELException: Unable to find a value for "SuperRole" in object of class "focus.entitiy.bean.User" using operator "."

To explain what I'm doing, a regular jsp posts the username and password to my loginservlet which uses the following code:




That uses the method loginQuery which is below:


As you can see once the login is valid it dispatches the request to menu.jsp which has the following code:



and just incase the getter and setter from userbean


I would be extremely grateful for any help anyone could give me
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Welcome to Javaranch

public boolean getSuperRole() {
return superRole;
}


The setter and getter of boolean attribute "superRole" is not by Java bean standards. It has to use isSuperRole and setSuperRole to get and set respectively.

<c:if test="${user.getSuperRole}" >


And then call using the bean attribute name and not by getter method.



 
eamonn dunne
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dude, thank you so much!
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Crossposted: http://forums.sun.com/thread.jspa?messageID=10599889#10599889
Please read this: http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites
 
eamonn dunne
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fair point, im a little embarrassed I didnt consider it myself. Will close other threads.
 
You've gotta fight it! Don't give in! Read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic