Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp , jar file should put where ?

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using tomcat 5.0. I develop a web application, but the jsp page can't find the jar file.

--myweb
-- index.jsp
-- web-inf
-- lib
-- myutil.jar

Then , in the index.jsp,
<%@page import="com.ddd.util.StringUtil"%>
<%
String[] data73_array = StringUtil.split(data73.trim(), ".");
%>

When tomcat compile, it can't find that myutil.jar.
java.lang.NullPointerException


I don't know why, so simple, but can't work out.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65545
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When tomcat compile, it can't find that myutil.jar.
java.lang.NullPointerException


If the problem was your jar not being found, you would be getting a package or class not found exception, not a null pointer exception.

Your problem lies elsewhere.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65545
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String[] data73_array = StringUtil.split(data73.trim(), ".");


What sets up data73? if it's null, you'll get the NPE.
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks , Bear, you are right. I found this error.

Thanks.
 
Maybe he went home and went to bed. And took this tiny ad with him:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!