• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with EL

 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

in a servlet i do

in the jsp, i do

that work fine...

i work like to use EL now...

i tried


but only ; is displayed...

any idea?

thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per forum instructions, what version of JSP?
 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i use netbeans 5 and java 1.5
if i check the jsp netbeans created.... there are some comment who talk about release 1.1
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Netbeans is an IDE, not a servlet container.
Find out what version of JSP the embedded container (Tomcat) supports.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed.

And if it turns out that your JSP version is indeed 1.1, then it's much too antiquated to even think about uaing the EL.

If so, you'll need to upgrade to Tomcat 5 which supports JSP 2.0.

The JSP FAQ covers this and how to set up your web.xml properly once you've updated your Tomcat version.
[ September 11, 2006: Message edited by: Bear Bibeault ]
 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
netbeans use tomcat 5.5 maybe the comment is just a warning to said we support min 1.1 release...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then be sure that your web.xml is set up using the Servlets 2.4 Schema rather than the Servlets 2.3 DOCTYPE. You'll find instructions in the JSP FAQ.

Then try something simple to make sure that the EL is enabled. Something like:

3 + 4 = ${3+4}

and see if it emits 7. If so, the EL is ok and your problem may lie elsewhere.
 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Then be sure that your web.xml is set up using the Servlets 2.4 Schema rather than the Servlets 2.3 DOCTYPE. You'll find instructions in the JSP FAQ.

Then try something simple to make sure that the EL is enabled. Something like:

3 + 4 = ${3+4}

and see if it emits 7. If so, the EL is ok and your problem may lie elsewhere.


ya i see 7
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. good. That eliminates setup issues as a possible suspect (which is usually the problem 90% of the time).

Now, we employ basic debugging techniques.

Place the getproperty version and the EL version side-by-side on the page. Do they yield the same output?

If not, I'd next suspect bean structure issues. The EL is very picky about properly formatted beans. Post your bean code.
 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
OK. good. That eliminates setup issues as a possible suspect (which is usually the problem 90% of the time).

Now, we employ basic debugging techniques.

Place the getproperty version and the EL version side-by-side on the page. Do they yield the same output?

If not, I'd next suspect bean structure issues. The EL is very picky about properly formatted beans. Post your bean code.


i don't really understand the getproperty and the EL version...


the javabean code
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At first glance, your bean looks fine.

Originally posted by mark smith:

i don't really understand the getproperty and the EL version...


Place both notations on the page and see what you get.
 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
work fine now

to use bean in the jsp, does i always need to use

request.getSession().setAttribute("beanID",member);

in the servlet?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a bean of that name does not already exist, and you use class= on the useBean action, it will create a bean of that type using the default constructor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic