Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.servlet.jsp.*. compiler error  RSS feed

 
srikanth arroju
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have both jsp-api and servlet-api in my common lib directory though i am still having problem when i am trying to compile a java file with import javax.servlet.jsp.*. I will greatly appreciate if any one can let me know what i am doing wrong.


tomcat-5.5 jsp-2.0
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kinds of errors? Are you certain that the pages are syntactically correct?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Placing the jar files in common/lib will automatically make them available at execution time but will do nothing automatic for you at compile time. You must still add them to your compilation class path.
 
srikanth arroju
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i solved the above problem by placing jsp-api.jar in ext directory of jdk
but now when i try to execute it displaying a exception

exception
org.apache.jasper.JasperException: org/apache/taglibs/standard/tag/rt/core/IfTag
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause
javax.servlet.ServletException: org/apache/taglibs/standard/tag/rt/core/IfTag
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:843)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:776)
org.apache.jsp.Ssc_jsp._jspService(Ssc_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause
java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/rt/core/IfTag
org.apache.jsp.Ssc_jsp._jspx_meth_c_if_0(Ssc_jsp.java:94)
org.apache.jsp.Ssc_jsp._jspService(Ssc_jsp.java:71)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
Srikkanth Mohanasundaram
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think the JSP you are trying to execute uses standard tags,try adding jstl.jar and standard.jar to WEB-INF/lib

Regards,
Srikkanth
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by srikanth arroju:
i solved the above problem by placing jsp-api.jar in ext directory of jdk


Bad idea. Now you have two copies of the jar which can easily get out of sync with each other. You should compile against the same jar that will be used at execution time.

Just add the common/lib jars to your compilation classpath.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!