bean: define problem in tomcat.But it is working fine in Jdeveloper. Why?

I am use a logic iterator tag for a dropdown list and bean :define for the show the values of the drop down list in jdeveloper. But in tomcat when i use this same code i got the following errors.

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 152 in the jsp file: /Trip_Consignor_Details_Insert.jsp

Generated servlet error:

[javac] Compiling 1 source file

/data/jakarta-tomcat-5.0.19/work/Catalina/localhost/Lost/org/apache/jsp/Trip_005fConsignor_005fDetails_005fInsert_jsp.java:315: cannot find symbol

symbol : method setValue(java.lang.Object)

location: class org.apache.struts.taglib.html.OptionTag

_jspx_th_html_option_0.setValue(param1);

^

An error occurred at line: 172 in the jsp file: /Trip_Consignor_Details_Insert.jsp

Generated servlet error:

/data/jakarta-tomcat-5.0.19/work/Catalina/localhost/Lost/org/apache/jsp/Trip_005fConsignor_005fDetails_005fInsert_jsp.java:414: cannot find symbol

symbol : method setValue(java.lang.Object)

location: class org.apache.struts.taglib.html.OptionTag

_jspx_th_html_option_1.setValue(param2);

^

Note: /data/jakarta-tomcat-5.0.19/work/Catalina/localhost/Lost/org/apache/jsp/Trip_005fConsignor_005fDetails_005fInsert_jsp.java uses unchecked or unsafe operations.

An error occurred at line: 172 in the jsp file: /Trip_Consignor_Details_Insert.jsp

Generated servlet error:

Note: Recompile with -Xlint:unchecked for details.

2 errors

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)

org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)

org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:763)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

I think this may caused for the following line of code--

<html:option value='<%=sUomCode%>'></html:option>

May i have to add a jar file for this tag in my classpath and keep the jar file in tomcat's [ jakarta-tomcat-5.0.19 ]/ common/lib?.

i am using ubuntu as os. Please suggest me.

[3219 byte] By [J2EE_professional] at [2007-11-26 12:17:28]
# 1
probabale the jar files, struts.jar, jstl.jar is not on the WEB-INF/lib dire`tory of your tomcat.. Jdeveloper has embedded struts.jar and jstl.jar so you must add them to your war file when deploying
jgalacambra at 2007-7-7 14:55:04 > top of Java-index,Archived Forums,Socket Programming...
# 2

thanks for your reply.

I keep these files in the lib and as i am using ubuntu operating system so i set classpath in environment file. But it does not working. still i am getting those errors.

my class path in enviornment file is

export CLASSPATH=/data/jakarta-tomcat-5.0.19/common/lib/struts.jar:/data/jakarta-tomcat-5.0.19/

common/lib/jstl.jar:/data/jakarta-tomcat-5.0.19/common/lib/standard.jar:/data/

jakarta-tomcat-5.0.19/common/lib/servlet-api.jar:/data/jakarta-tomcat-5.0.19/common/lib/jsp-api.jar:/data/jakarta-tomcat-5.0.19/common/lib/struts-menu-2.4.2.jar

even i used eclipse id i got the same error. please suggest me to recover the problem

J2EE_professional at 2007-7-7 14:55:04 > top of Java-index,Archived Forums,Socket Programming...
# 3

1. Tomcat on installation will know on which classpath it will use.. the common/lib directory of tomcat will act as the common location for jar files. If you want a jar file to be accessed only by an application put it on the applications WEB-INF/lib directory

2. If you using eclipse 3.2 right click on the project and select properties. Then select Java Build Path. Select the libraries tab and add the jars that you needed.

3. On Jdeveloper 10 build 10.1.2 or 10.1.3 you can start a struts project.. the struts and jstl jar files will be automatically set on your class path.

jgalacambra at 2007-7-7 14:55:04 > top of Java-index,Archived Forums,Socket Programming...
# 4

When i used tomcat i use the classpath --

export CLASSPATH=/data/jakarta-tomcat-5.0.19/common/lib/struts.jar:/data/jakarta-tomcat-5.0.19/

common/lib/jstl.jar:/data/jakarta-tomcat-5.0.19/common/lib/standard.jar:/data/

jakarta-tomcat-5.0.19/common/lib/servlet-api.jar:/data/jakarta-tomcat-5.0.19/common/lib/jsp-api.jar:/data/jakarta-tomcat-5.0.19/common/lib/struts-menu-2.4.2.jar

so i don't think their is any problem to set the jar [jstl.jar and standard.jsr].

even when i used eclipse id according to your suggestion i got a error message if i add two jars from outside.Most probably elipse alread used those jars.

So still now i am not able to use jstl. What should i do now to recover from this problem.

please suggest.

J2EE_professional at 2007-7-7 14:55:04 > top of Java-index,Archived Forums,Socket Programming...
# 5

where do you use this classpath?

export CLASSPATH=/data/jakarta-tomcat-5.0.19/common/lib/struts.jar:/data/jakarta-tomcat-5.0.19/

common/lib/jstl.jar:/data/jakarta-tomcat-5.0.19/common/lib/standard.jar:/data/

jakarta-tomcat-5.0.19/common/lib/servlet-api.jar:/data/jakarta-tomcat-5.0.19/common/lib/jsp-api.jar:/data/jakarta-tomcat-5.0.19/common/lib/struts-menu-2.4.2.jar

and how do you set your classpath in your eclipse?

jgalacambra at 2007-7-7 14:55:04 > top of Java-index,Archived Forums,Socket Programming...
# 6

I set the classpath in enviornment file in /etc folder.

and in eclipse i did-- right click on project -->properties-->java build path-->Libraries-->Add External jars. [and add the two jars].

My code is -

<html:select property="sLocCode">

<logic:iterate id="results" name="tripConsignor" property="result">

<bean:define id="param1" name="results" property="sLocCode"/>

<html:option value='<%=param1%>'></html:option>

</logic:iterate>

</html:select>

problem in the line -

<html:option value='<%=param1%>'></html:option>

Is their any alternative to set the html values. I tried <bean:write>. But failed.

So i just want to set the value of <html:option value="--"></html:option>.

please give me the solution or alternative way to set the value. Please Help

J2EE_professional at 2007-7-7 14:55:04 > top of Java-index,Archived Forums,Socket Programming...
# 7
<html:option value='${result.whateverValue}></html:option>'>
jgalacambra at 2007-7-7 14:55:04 > top of Java-index,Archived Forums,Socket Programming...
# 8

many many thanks for ur valuable suggestion.

i used <html:option value='${result.whateverValue}></html:option>'> process. It is not working. But i solve my problem. I used Eclipse another version and plugin. And i am now able to use jstl tag and not getting any errors. So thanks again for sharing your opinion with me. Many many thanks.

J2EE_professional at 2007-7-7 14:55:04 > top of Java-index,Archived Forums,Socket Programming...