Tontang Bei

Ranch Hand
+ Follow
since Oct 21, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tontang Bei

THANKS Michael. It works now. This is probably the last time I'm going to use notepad again.!!(and code without my glasses )
Yes both the jars are included as directed on page 434. but still no luck.
NO,I called the servlet first. Not the JSP.
The example on page 436. I have set a an array in a servlet like shown below:



Then in the result.jsp I have done below:


But the ouput I get shown is:
<@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> Movie List

Im not being shown the list of movies as shown on p 436. Why?
Hi Jeanne,
Thanks for your reply. I warred up the app as your suggested. But Im still not sure how to get this thing up and running in eclipse. I first created a web project in eclipse, and then wen to file->import->archive file. But now I have a whole bunch of errors, and the directory structure to the left looks all screwed up. The errors are mainly due to none of packages being found. Also because I had to create a project first, the unwarred project has become a subproject or something it seems
[ May 27, 2007: Message edited by: Tontang Bei ]
I have a webapp that I run on Tomcat that I made with a simple editor. I now want to open this and work on this project inside eclipse. How can I do it?
Im reading from this book called Eclipse in Action. I have downloaded the sysdeo plugin for Tomcat placed it in the correct directory. But when I go into windows->customize perspective->java .. I don't see a 'Tomcat Project' . Or windows->preferences, still nothing no sign on Tomcat. what could be wrong? Ive tried playing around with Different JVMs as suggested by some websites but still nothing. I know I have placed the plugin at the right location because Ive see other websites in addition to the book.

In my servlet:

I get output Null for both Attributes that I set. What am I doing wrong? Ive even tried using hidden form fields in the JSP to send. But still the result is Null in my servlet for some reason. I can see their outputted values in the JSP for sure when I use <%=%> . Any help is welcome
13 years ago
JSP
Here is the code for the applet

Here is the cod for the html page



on the command line I type: appletviewer Drop.html and I get a whole bunch of exceptions.

C:\Jav_Dev>appletviewer Drop.html
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:183)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:127)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at Drop.init(Drop.java:17)
at sun.applet.AppletPanel.run(AppletPanel.java:417)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: C:\Jav_Dev\com\mysql\jdbc\Driver.class (The system cann
ot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)

at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:295)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:44)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:173)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:170)
... 9 more
java.lang.NullPointerException
at Drop.loadTables(Drop.java:43)
at Drop.init(Drop.java:25)
at sun.applet.AppletPanel.run(AppletPanel.java:417)
at java.lang.Thread.run(Thread.java:619)
13 years ago
Sorry, I mean after the user hits the submit button the values are extracted in a servlet
I have a web page that forwards listbox selected values to my servlet that receives it in a String Array. How would I insert this into a dbase? Is there some datatype in mysql that can help me with this? or should I format all the values into one String and then insert it normally?
"A useful constraint is to say that any instance of the superclass must be an instance of one of the subtypes of a group.(The superclass is then abstract)."

The above is from UML distilled. Can someone explain me with example(preferably) what exactly this means??
Ok, but how do you send an object to a Java class from a JSP? is that not recommened?
13 years ago
JSP
I have a JSp where I want to add an object to the session and then forward it to a java class. With servlets we have this kind of code

HttpSession session=request.getSession()
session.setAttribute("user",user);

RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/url");
dispatcher.forward(request,response);

How do I do this in JSP. ?
13 years ago
JSP
This is not a post to request changing to Java or anything. BUt with CGI how are servers keeping with this ever growing site? don't your servers ever run out of memory with each new request? Also out of curiosity have you noticed anything that CGI offers that isn't or could be better offered withs servlets and jsp? or anything that you like about CGI?
13 years ago