• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

problem with EL

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As per forum instructions, what version of JSP?
 
mark smith
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic