• Post Reply Bookmark Topic Watch Topic
  • New Topic

el code showing on web page  RSS feed

 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just move my web application over to a hosted web server. THe main difference is they use apache in front of tomcat. In my test enviornment i just use tomcat.

THis is the code in the jsp file


${vendor.vName} is showing on the page. I dont have anything in the DB yet to fill this field but either way it should show on the page. Is there something wrong in my code or do i need them to look at the server to see if its configured correctly. THis code works fine on my test system
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do a View Source on the page. Is the JSTL markup still there? If so, Apache may not be handing over the dynamic resources to Tomcat properly. If not, and it's just the EL that's not being evaluated, the web app may be misconfigured (or perhaps there's a Tomcat version mismatch?).
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is from the page source:


${vendor.vName} this block shoud be blank correct?
i did develop this on apache-tomcat-6.0.16 the server is using apache-tomcat-5.5.25
[ October 23, 2008: Message edited by: John Schretz ]
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

1. do you properly configure jstl.jar in your application?
This Helps


2. do you put something like below on your the particular jsp?

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
[ October 23, 2008: Message edited by: seetharaman venkatasamy ]
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i have it configured that way.

Now i just changed my tomcat version to the one that is on the hosted server and i am getting the sam result as on the hosted server. What could this be?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you carefully check this ?
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is from the server file


which jar files should i be using with that version?
i dld the files from this link http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi
[ October 23, 2008: Message edited by: John Schretz ]
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If EL is displayed everywhere, what about the <el-ignored> tag in the DD?


Hope this helps
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So there is nothing wrong with the code i posted right?

yes the el is displayed on all pages i have it coded in
"what about the <el-ignored> tag in the DD?"

where would i look for this?
[ October 23, 2008: Message edited by: John Schretz ]
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John Schretz:
yes the el is displayed on all pages i have it coded in
"what about the <el-ignored> tag in the DD?"
where would i look for this?


under the WEB-INF directory

DD is nothing but web.xml in that you can find el-ignored under the jsp-property-group

Hope This Helps
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm i can find el-ignored anywhere in the web.xml

I dont get it i downloaded the same version as the server, put the appropriate jars in my class path and it still doesnt work.

I am trying to get them to upgrade tomcat, but they are going to charge me for it. could only guess how much that will be.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jar files have nothing to do with the EL post JSP 2.0, so that shouldn't be the problem.

What version of Tomcat are we talking about? JSP 2.0 is supported by Tomcat 5 and above.
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the hosted server that it is not working correctly on is using tomcat 5
My test server at home is using tomcat 6 which all my code works on.

As soon as I switched to tomcat 5 on my home server i got the same result as my hosted server, where i could actually see the code on the page.

the jstl and standard jars are in my web-inf folder under lib.

nd this record in in my tomcat 5 web xml
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

do i need any other files or jars for this to work correctly?

they want to charge me 150.00 to upgrade to tomcat 6
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greedy, aren't they? ;)

You should have no problem getting this to work on Tomcat 5. And again, the EL is a core part of JSP, so no jar files are involved.

In your Tomcat 5 installation, create a simple JSP in the root of your web application that contains the expression: ${3 + 4} and not much else. Does it display the expression or 7?
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm it shows 7

if ${vendor.vName} came back blank or null from the servlet after querying the DB should it show the expression or just be blank?

does it look like there is something wrong with my code i initially posted?

edit:

i just added ${vendor.vName} to the test page and in that case it did not show the expression. i am sooo confused.
[ October 24, 2008: Message edited by: John Schretz ]
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
apparently this line in my header.jsp file was giving me an issue
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>

when i took this out it works as it should.

any ideas why?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John Schretz:
hmm it shows 7

if ${vendor.vName} came back blank or null from the servlet after querying the DB should it show the expression or just be blank?



so, i guess there is nothing problem with your EL configuration.

the problem lies here in ${vendor.vName}

what is your getter name in your java class?

example:
if your getter name is getValue() then ${vendor.value}

if your getter name is getVName() then ${vendor.vName}

Hope This Helps
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!