Jeffrey Ye

Greenhorn
+ Follow
since Feb 18, 2006
Merit badge: grant badges
For More
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 Jeffrey Ye

what's the correct order to run struts program?

i think it may be:

deploy tomcat->run tomcat->http://localhost....

but,if i edit the code again,do i need to restart the tomcat?

and ,how to restart tomcat,i can not find the "restart" buttom in MyEclipse

there are only "start" and "stop" button,that means i should stop the

tomcat and start it again.
i follow the MyEclipse manual demo write a simple login program,but

when i enter:http://localhost:8080/LoginDemo/userLogin.jsp

the ie show the follow problem:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Cannot retrieve mapping for action /userLogin
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:88)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.jsp.JspException: Cannot retrieve mapping for action /userLogin
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:723)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:419)
org.apache.jsp.userLogin_jsp._jspx_meth_html_form_0(userLogin_jsp.java:104)
org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.
17 years ago
c/s mean client/server;

it seems client/server mode has no relation with browser/server mode

so,whether a jsp programer don't need to have background of java network

development,such as ftp,smtp
18 years ago
JSP
i recently borrow a book about java net program,which is describe in c/s
mode.

i am a jsp new be.

it seems one can write jsp without c/s net bachground.

is't true?
18 years ago
JSP
i run this program in eclipse,but when i enter the file name

and press the enter in Console windows in eclipse;

i can not see the result,

is the Console windows in eclipse is only for output,

not for input form keyboard?

how to run this program in eclipse?

import java.io.*;

public class CountBytes {
public static void main(String[]args) throws IOException{
InputStream in;

//get the file name
if(args.length==0)
in=System.in;
else
in=new FileInputStream(args[0]);
//count the byte of file
int total=0;
while(in.read()!=-1)
total++;
System.out.println(total+"bytes");
}
}
i have studied java for a 2 month,

and i can finish some difficult devepment following the book code,

such as jsp,xml,jdbc,servlet,RMI

and i can understand almost all the code in some senial J2ee books.

but,when i throw out the book,i can not even write a simple IO program.

what's wrong with me?
18 years ago
import java.sql.*;

public class UseDriver {
public static void main(String[]args){
String url="jdbc:mysql://localhost/sql_test";
String userName="root";
String password="yese04";
String sql=null;
Connection conn=null;
Statement stmt=null;
//
try{
//load the driver class
Class.forName("com.mysql.jdbc.Driver");
}
catch(ClassNotFoundException e){
System.err.println("class not found");
}
//connect database
try{
conn=DriverManager.getConnection(url,userName,password);
//create statement
stmt=conn.createStatement();
//operation the database
sql="insert into student"+"values('20','jack','2000/02/03','beijing')";
//execute the statement
stmt.executeUpdate(sql);
System.out.println("inser successful");
}
catch(SQLException e){
System.err.println("insert sql error");
}
finally{
try{
stmt.close();
conn.close();
}
catch(SQLException e){
System.err.println("close error");
}
}
}
}


error message:



#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_FLT_STACK_CHECK (0xc0000092) at pc=0x00dd0618, pid=2960, tid=2964
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# v ~RuntimeStub::init_check_patching Runtime1 stub
#
# An error report file with more information is saved as hs_err_pid2960.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
....i want a case tool for enterprise development in eclipse.

which case tool is more suietable?
i only known Rose, PowerDesigner, Together

which is more suitable for beginner?
how to write code in "???" in the following code:

//special location of database on filesystem
System.setProperty("???","D:/mysql-connector-java-3.0.17-ga");

//load database driver class
Class.forName(org.gjt.mm.mysql.Driver);

//establish connection to database
statement=connection.createStatement();

//query database
ResultSet resultset=statement.executeQuery("select*from author");

i can't find answer in sun

the database i want load is located in"D:\Program Files\MySQL\MySQL Server 5.0\data\test"
[ February 25, 2006: Message edited by: Bear Bibeault ]
i'm a beginner for oo;

i found it very hard to set up a model of a pipeline,or assembly line for

my clients.

does it need the desighn patten,or UML tool(Rose,or Together),

or advanced mathematic knowlege(i'm not good at it).
maybe a stupid question

i think a programmer don't need to master Ejb,unless your company need it.

is that ture?
when i enter <head>, the code </head> appear automatically

but when i enter <% ,,why no code assist "%>" appear?

somebody help me
18 years ago
JSP
are they all the structures for j2ee?
18 years ago
i'v learn java for a long time

now,i want to enter j2ee

i buy a book:<<structs project and practic>>

and set up a tech workplace as book tell:Jcreator+tomcat+structs.bin+MySQL

is struts a good tool for j2ee beginners?
18 years ago