HELP for JSP execute folder.
I have prepared Linux server with Tomcat and Apache servers, connect it to using mod_jk.
Apache and Tomcat are work fine following LINK.
http://localhost/examples/jsp/
But , when I access JSP from my folder which I made it same folder "examples" is not working.
http://localhost/mytest/test.jsp
(This is my folder which i want to call all my JSP file.)
It display following error message:
Apache Tomcat/4.0.4 - HTTP Status 404 - /mytest/test.jsp
type Status report
message /mytest/test.jsp
description The requested resource (/mytest/test.jsp) is not available.
What can i do, HELP ME ???
You put folder mytest in CATALINA_HOME/webapps?
try whit http://localhost:8080/mytest/test.jsp
Similar Messages
-
How do I get JavaDoc help for the JSPs. what settings do I need to make in the Jdeveloper.
Atpresent,I am getting help for standard java.
Any suggestions...?This jsp:plugin tag should work. BUt the problem is that not showing image from jar file. but ok when used with html applet tag.
-
Please Help me: JSP executes iReport
Hello,
I have Tomcat 5.0 and iReport in my computer (the server computer).
I want to execute iReport on the server via a JSP.
I use "Runtime.getRuntime().exec("cmd.exe /C iReport.cmd");" on the JSP and the iReport it's executed on my computer.
But when I tried to execute iReport on another machine that connected the server via TCP/IP, iReport executes on the server computer not in the client computer.
Are there any mode that iReport executes on client computer??
If the answer is afirmative, please tell me how.
Thank you.
P.D. Excuse me for my bad english.This java program can be executed in a java shell -->
java it.businesslogic.ireport.gui.MainFrame
Can I execute this in a JSP??It will still run only on the Server. Like was said, JSPs and Servlets run on the Server's JVM (and before the HTML gets delivered to the client. Your best bet to get it to run on the client side is to use an Applet or Java Web Start (do a search for them). But if that will let you do what you want? Now it will be running on the Client, and not the Server. so if you are trying to report on Server resources, you will might not be able to. I would ask the IReport people on how to get that going, if possible. -
F4 Help for Presentation Server Folder Name .
Hi Experts,
I want show the F4 help on the presentation server.
If the file is selected REquirement is that , on clicking the F4, the dialog box should open.
If we choose the file , then file should be selected , but if we select the folder then folder should be selected.
Normal function modules or methods present in SAP opens the folder containt in the folder.
Kindly provide anyFM name or class method name o achieve the functiknality .
Thanks in advance.HI,
Please paste this code,You will get F4 help.
DATA: lt_filetable TYPE filetable,
lwa_filetable TYPE file_table,
l_rc TYPE i.
REFRESH lt_filetable[].
CLEAR:lwa_filetable.
* Open file
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = lt_filetable
rc = l_rc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
READ TABLE lt_filetable INTO lwa_filetable INDEX 1.
IF sy-subrc = 0.
p_sap1 = lwa_filetable-filename.
ENDIF.
ENDIF. -
The applet is not showing image on applet when running through following url. Remember It runs by simple applet tag in html but not through <jsp:plugin tag in jsp file.
the following two links for same inker.jar file.
not ok not running=====>"http://mycgiserver.com/~aftmycgijsp/jhan3.jsp"
ok runing==============>"http://mycgiserver.com/~aftmycgijsp/jhan3.html"
a) Tum.class in inker.jar with Image.jpg contain following code:
image2 = getImage(getCodeBase(),"Image.jpg");
g.drawImage(image2,0,0,this);
b) I am using following tags in my jsp file,
jhan3.jsp
<html>
<head>
<jsp:plugin type="applet" code="Tum.class" codebase="http://www.mycgiserver.com/~aftmycgijsp/applets/jhan" jreversion="1.2" archive="inker.jar" width="171" height="185" >
<jsp:fallback>
Plugin tag OBJECT or EMBED not supported by browser.
</jsp:fallback>
</jsp:plugin>
</body>
</html>
c) and the source file in my browser appears for above jsp is translated as to me as,
<html>
<head>
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0" height="185" width="171">
<param name="java_archive" value="inker.jar">
<param name="java_codebase" value="http://www.mycgiserver.com/~aftmycgijsp/applets/jhan">
<param name="java_code" value="Tum.class">
<param name="type" value="application/x-java-applet;version=1.2">
<comment><embed type="application/x-java-applet;version=1.2" codebase="http://java.sun.com/products/plugin/" height="185" width="171" java_archive="inker.jar" java_codebase="http://www.mycgiserver.com/~aftmycgijsp/applets/jhan" java_code="Tum.class">
<noembed></comment>
Plugin tag OBJECT or EMBED not supported by browser.
</noembed></embed></object>
</body>
</html>
please send any suggestions.This jsp:plugin tag should work. BUt the problem is that not showing image from jar file. but ok when used with html applet tag.
-
Need help for JSP Dynpro error
Hi Friends,
I am working with the JSP Dynpros. Suddenly I am getting the predictable error which I have copied the blow log code. Can you check it once and any one describe this. Do the needful.
<b>Log:</b>
#1.5#000F20F7B2D5003B0000028D0000142000043A63023147B2#1190096819836#com.sap.engine.library.monitor.mapping.ccms.Trace##com.sap.engine.library.monitor.mapping.ccms.Trace######7dbad27065af11dca755000f20f7b2d5#SAPEngine_System_Thread[impl:5]_54##0#0#Error##Plain###<b>RegisterNode</Applications/KM Collaboration/SCF/Service Connectors>: com.sap.engine.library.monitor.mapping.ccms.CcmsConnectorException: 5347450: Invalid configuration group for node'/Applications/KM Collaboration/SCF/Service Connectors'</b> (APP.KM.Collaboration.SCF.ConfiguredConnectors, max. 40 characters)#
#1.5#000F20F7B2D5003B000003630000142000043A6302D32E12#1190096830462#com.sap.engine.services.deploy##com.sap.engine.services.deploy######7dbad27065af11dca755000f20f7b2d5#SAPEngine_System_Thread[impl:5]_54##0#0#Error#1#/System/Server#Plain###Error occurred while initially starting application sap.com/tcmobileadminea:Application sap.com/tcmobileadminea cannot be started. Reason: it has hard reference to resource tc_SL_SDM_Client with type library, which is not active on the server.#
#1.5#000F20F7B2D50002000000020000142000043A6651DA4DD8#1190111041232#com.sap.engine.services.httpserver##com.sap.engine.services.httpserver######46105d0065d111dca667000f20f7b2d5#SAPEngine_System_Thread[impl:5]_19##0#0#Error#1#/System/Server#Plain###User <system thread>, <b>IP address
Long data transfer callback received from client [1129728] for an already processed request. Callback will be skipped.#</b>
Advanced thanks
Thanks
Venky.Please see these errors
I am trying to push IDM Users into AD but getting these errors in AS Logs
</Attribute>
<Attribute name='originalAssignedLhPolicy' value='Default Identity Manager Account Policy'/>
<Attribute name='password' value='change12345'/>
<Attribute name='prevEffectiveLhPolicy' value='Default Identity Manager Account Policy'/>
<Attribute name='questions'>
<List>
<Object name='Qa0ee8f8afc0293b6:77a34d0d:11eca669c58:-7e53'>
<Attribute name='answerObfuscated' value='false'/>
<Attribute name='id' value='a0ee8f8afc0293b6:77a34d0d:11eca669c58:-7e53'/>
<Attribute name='loginInterface' value='UI_LOGIN_CONFIG_DISPLAY_NAME_ALL_INTERFACES'/>
<Attribute name='question' value='What is your favorite pet's name?'/>
</Object>
</List>
</Attribute>
<Attribute name='resources'>
<List>
<String>AD</String>
</List>
</Attribute>
<Attribute name='roleInfos'/>
<Attribute name='selectedRoleType' value='AllRoleTypes'/>
</Object>
</Attribute>
</Object>
2009-01-12T17:15:56.108+0530: Error processing updates
2009-01-12T17:15:56.108+0530: There was an error in activesync processing.
2009-01-12T17:15:56.123+0530: java.lang.NullPointerException
2009-01-12T17:15:56.342+0530: Looking for deletes with filter: (uSNChanged>=457812)
2009-01-12T17:15:56.546+0530: Poll complete.
2009-01-12T17:15:56.561+0530: SARunner: loop 423
2009-01-12T17:15:56.655+0530: Started - Error, paused until Mon Jan 12 17:15:56 IST 2009
2009-01-12T17:16:01.675+0530: Pause completed -
i want to increase a new function in existing web site, just like let customer leave their comment for our product and collect it back to company, after modify or delete these no good one, then post it on to the website....i am a beginner,,,, wish any kind ppls can leave some comment for me...thanks a lot
Since you are a beginner, I'd advice you to take a
look at Marty Hall's website
http://www.coreservlets.com/. You can download the
first edition of his book "core servlets and Java
Server Pages" in pdf format. I like Marty Hall's books too, but I prefer Hans Bergsten's JSP book as a starter.
Try to find something about the MVC or Model View
Controller design pattern. This may seem like
overkill for small web apps, but as soon as you're
trying to add some functionality (as you want to do),
you'll see that you gain time using the MVC.
For this, I strongly recommend the "Apache Tomcat
Bible" from Eaves, Jones and Godfrey.
It explains how to install Java SDK, MySQL, Ant,
Eclipse, Tomcat.Personally, I think all this is beyond the OP. He said he was a beginner. If that means he hasn't even written "Hello, World" or compiled a single Java program, I'd say that all this stuff about Tomcat, Ant, Eclipse, serlvets, and JSPs is well beyond him. I'd discourage anyone from taking on a project like this as their introduction to Java. I'd warn his client against spending their money to buy code from a neophyte. There are plenty of talented people out there who need the work and can do the job without having to climb that learning mountain.
If I've misread the situation, I apologize. No insult intended. Just be realistic in assessing your ability and the difficulty of the project.
% -
Help needed in executing the java/jsp program from UCM .
Hi ,
I have a .jsp program running in my Jdeveloper which when executed pops a window to browse and select files and with few custom options .
But i want to execute that Program from within UCM (create a new jsp page in UCM OR provide link ? i am not sure .... ) , could anyone help on how i can execute/run the program from UCM ?
thanks in Advance
PlaxmanIf your jsp makes use of jars you may want to look into using a WAR instead. You can check the WAR into content server and there is even a link on the administration page for JSP Web App Admin. Treating the JSP(s) and jar(s) as an entity may be a more successful path for you.
You can find some jsp examples and ever a war example in this directory: <install root>\samples\JspServer
And the briefest of help about that stuff here: [http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm|http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm] -
Unable to compile class for JSP--- help me plz!!!!!
hi friends;
Pease suggest me where i am wrong, i think javabean is not instantiated in jsp file.may be it is related to the classpath of javabean. i have not set any variable for javabean classpath. and i put javabean class file in
TOMCAT_HOME/webapps/test3/WEB-INF/UseDta.class
and all the jsp and html in /test3. my jsp an javabeans are--
1. GetName.html
<HTML>
<BODY>
<FORM METHOD=POST ACTION="SaveName.jsp">
What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
<P><INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>
2. SaveName.jsp
<jsp:useBean id="user" class="UserData" scope="session">
<jsp:setProperty name="user" property="*"/>
</jsp:useBean>
<HTML>
<BODY>
Continue
</BODY>
</HTML>
3. UserData.java
public class UserData {
String username;
String email;
int age;
public UserData(){}
public void setUsername( String value )
username = value;
public void setEmail( String value )
email = value;
public void setAge( int value )
age = value;
public String getUsername() { return username; }
public String getEmail() { return email; }
public int getAge() { return age; }
4. NextPage.jsp
<jsp:useBean id="user" class="UserData" scope="session"/>
<HTML>
<BODY>
You entered<BR>
Name: <%= user.getUsername() %><BR>
Email: <%= user.getEmail() %><BR>
Age: <%= user.getAge() %><BR>
</BODY>
</HTML>
url: http://localhost:8080/test3/GetName.html
is it related to context path??
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 2 in the jsp file: /SaveName.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test3\org\apache\jsp\SaveName_jsp.java:44: cannot find symbol
symbol : class UserData
location: class org.apache.jsp.SaveName_jsp
UserData user = null;
^
An error occurred at line: 2 in the jsp file: /SaveName.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test3\org\apache\jsp\SaveName_jsp.java:46: cannot find symbol
symbol : class UserData
location: class org.apache.jsp.SaveName_jsp
user = (UserData) jspxpage_context.getAttribute("user", PageContext.SESSION_SCOPE);
^
An error occurred at line: 2 in the jsp file: /SaveName.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test3\org\apache\jsp\SaveName_jsp.java:48: cannot find symbol
symbol : class UserData
location: class org.apache.jsp.SaveName_jsp
user = new UserData();
^
3 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:437)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
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.
Apache Tomcat/5.0.30
please Reply me ASAP
i'll be glad if you reply. pleaseI am using Tomcat 6.0.
I have put my UserData class in user package and
used in below jsp(SaveName.jsp)
<%@ page import="user.UserData" %>
<jsp:useBean id="user" class="user.UserData" scope="session"/>
<jsp:setProperty name="user" property="*"/>
<HTML>
<BODY>
Continue
</BODY>
</HTML>
I have already set my classpath as C:\Documents and Settings\user\My Documents\Java\apache-tomcat-6.0.16\apache-tomcat-6.0.16\webapps\ROOT\WEB-INF\classes;
UserData class is in C:\Documents and Settings\user\My Documents\Java\apache-tomcat-6.0.16\apache-tomcat-6.0.16\webapps\ROOT\WEB-INF\classes\user
My UserData class is
package user;
public class UserData {
String username;
String email;
int age;
public UserData(){
this("","",0);
System.out.println("najn thanne puli");
public UserData(String username,String email,int age){
this.username=username;
this.email=email;
this.age=age;
public void setUsername( String value )
username = value;
public void setEmail( String value )
email = value;
public void setAge( int value )
age = value;
public String getUsername() { return username; }
public String getEmail() { return email; }
public int getAge() { return age; }
But running SaveName.jsp shows exception
org.apache.jasper.JasperException: /SaveName.jsp(2,0) The value for the useBean class attribute user.UserData is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1160)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Generator.generate(Generator.java:3372)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
Please help me.thanks in advance. -
JasperException: Unable to compile class for JSP HELP
I added couple of extra class files into the jar file.. and now its not able to find it! I am running JBoss latest version and using eclipse... any help wud be nice
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
Only a type can be imported. org.jfree.chart.servlet.WebHitChart resolves to a package
Generated servlet error:
Only a type can be imported. org.jfree.chart.servlet.WebHitDataSet resolves to a package
An error occurred at line: 10 in the jsp file: /bar_chart.jsp
Generated servlet error:
WebHitChart cannot be resolved
An error occurred at line: 10 in the jsp file: /bar_chart.jsp
Generated servlet error:
WebHitDataSet cannot be resolved
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
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:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)just a random guess...
I had a ton of issues with JBoss and jfreechart. JBoss uses a different classloader, and its internal versions of the jfreechart classes will be loaded before yours, causing all sorts of issues. Dig through the jboss directories and you'll find a different, older version of jfreechart of one of its classes. Remove them and you'll be in better shape.
Alternatively, look around the JBoss docs for how to disable/turn off the unified classloader for your app (its a directive in jboss-web.xml IIRC). This should make the classloader for your webapp perform to spec, getting rid of the class colission issues. -
Help for documentation about jsp and tomcat
Hello
This is realy very urgent for me!!Does anuone can help me.
There is my problem .I nead books (hypperlink) for jsp or tomcat.
who made it why and how does it looks.I am writeing documenation for my project and i have to finish it very soon.I found some tutorials btu it is noy enough if you know for something better i would be vry gratefull.
ByHi,
I agree, the basic documentation at the jakarta site is good, but needs a little polishing/updating.
Use google to do a search, and wade through loads of stuff before coming up with the answers, or this site is pretty good too!!!!!
Unfortunately, all the answers are not always forthcoming until you know which questions to ask (or the relevant words to enter into a search engine).
best
kev -
Unable to compile class for JSP
Please can anyone help me to solve this.
Actually,this is the condition.
In my db,there is a table called UserPassword, which has 4
fields(empNo,UserName,password,level). Now I want to do these things:
When the user submits the data to create a new account via HTML form, it submits the data to the file called CreateAcc.jsp. In this file it perform some logic,here are they.
1)To check the empNo,if it is already exist in the DB,
if empNo =exist then display error.(record already exist)
if empNo =notexist then do task 2).
2)check the UserName,if it is already exist in the db,
if UserName=exist then display error.(because it's a primary key)
if UserName=notexist then do task 3).
3)Create a new user account and save it to the db.
To do these tasks,I never create a new objects for the tasks 1) and 2).
only for task 3)create an object.
Is it the right way?
Here is the file CreateAcc.jsp
<%@ page language="java" %>
<%@ page import="core.UserAccManager" %>
<%@ page import="data.UserPassword" %>
<jsp:useBean id="UserAccManager" class="core.UserAccManager" scope="session"/>
<jsp:setProperty name="UserAccManager" property="*"/>
<jsp:useBean id="UserPassword" class="data.UserPassword" scope="session"/>
<jsp:setProperty name="UserPassword" property="*"/>
<%
String nextPage ="MainForm.jsp";
if(UserPassword.verifyEmpno()){
if(UserPassword.verifyUsername()){
if(UserPassword.createAcc()) nextPage ="MsgAcc.jsp";
}else{
nextPage="UserNameExist.jsp";
else{
nextPage="UserAccError.jsp";
%>
<jsp:forward page="<%=nextPage%>"/>The directory structure:
UserPassword.java- F:/Project/core/data/UserPassword.java
UserAccManager.java - F:/Project/core/UserAccManager.java
Now both are compiling.I put the class files into the TOMCAT,as follows.
UserAccManager.class - webapps/mySystemName/WEB-INF/classes/core/
UserPassword.class - webapps/mySystemName/WEB-INF/classes/core/data/
Here is the full code of the file UserAccManager.java.
package core; //Is this right?
import data.UserPassword; //Is this right?
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public final class UserAccManager{
private static final String DRIVER = "com.mysql.jdbc.Driver";
private static final String URL = "jdbc:mysql://localhost:3306/superfine";
private static Connection connection;
private static PreparedStatement pstmt1;
private static PreparedStatement pstmt2;
private static PreparedStatement pstmt3;
private UserAccManager(){
// Initializes the connection and statements
public static void initConnection() {
if (connection == null) {
try {
String sql;
// Open the database
Class.forName(DRIVER).newInstance();
connection = DriverManager.getConnection(URL);
// Prepare the statements
sql = "SELECT * FROM UserPassword where empNo= ?";
pstmt1 = connection.prepareStatement(sql);
sql = "SELECT UserName FROM UserPassword where UserName= ?";
pstmt2 = connection.prepareStatement(sql);
sql ="INSERT INTO UserPassword VALUES(?,?,?,?)";
pstmt3 = connection.prepareStatement(sql);
catch (Exception ex) {
System.err.println(ex.getMessage());
// Closes the connection and statements
// Method to be called by main class when finished with DB
public void closeConnection() {
//same as previous
public static boolean verifyEmpno(int empno) {
boolean emp_no_select_ok = false;
int emp = -1;
initConnection();
try {
pstmt1.setInt(1, empno);
ResultSet rs1 = pstmt1.executeQuery();
while(rs1.next()){
emp=rs1.getInt("empNo");
if(emp>0)
emp_no_select_ok = false;
} else{
emp_no_select_ok = true;
rs1.close();
pstmt1.close();
catch (Exception ex) {
System.err.println(ex.getMessage());
return emp_no_select_ok;
public static boolean verifyUsername(String username) {
boolean user_name_select_ok = false;
String user = "xxxx";
initConnection();
try {
pstmt2.setString(1, username);
ResultSet rs2 = pstmt2.executeQuery();
while(rs2.next()){
user=rs2.getString("UserName");
if(!user.equals("xxxx"))
user_name_select_ok = false;
} else{
user_name_select_ok = true;
rs2.close();
catch (Exception ex) {
System.err.println(ex.getMessage());
return user_name_select_ok;
public static boolean createAcc(int empno, String username, String password, int
level){
boolean create_acc_ok = false;
initConnection();
try{
//create a new object,from the UserPassword table.
UserPassword useraccount = new UserPassword();
useraccount.setEmpno(empno);
useraccount.setUsername(username);
useraccount.setPassword(password);
useraccount.setLevel(level);
//assign value for ???
pstmt3.setInt(1, useraccount.getEmpno());
pstmt3.setString(2, useraccount.getUsername());
pstmt3.setString(3, useraccount.getPassword());
pstmt3.setInt(4, useraccount.getLevel());
if(pstmt3.executeUpdate()==1) create_acc_ok=true;
pstmt3.close();
//con.close();
catch(SQLException e2){
System.err.println(e2.getMessage());
return create_acc_ok;
}here is the bean (part of it)
package data; //is it right?
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class UserPassword
private int empno;
private String username;
private String password;
private int level;
// Constructor
public UserPassword()
this.empno = empno;
this.username = username;
this.password = password;
this.level = level;
// setters and getters are here.
// public boolean verifyEmpno() {
// return UserAccManager.verifyEmpno(empno);
// public boolean verifyUsername(String username) {
// return UserAccManager.verifyUsername(username);
// These 2 methods not compile with or without para's.So I leave that job for the
//controll class UserAccManager.java.
Now my problem is this: When I submit data, there is an error;org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:8:
cannot access core.data.UserPassword
bad class file: C:\Program Files\Apache Group\Tomcat
4.1\webapps\HRM\WEB-INF\classes\core\data\UserPassword.class
class file contains wrong class: data.UserPassword
Please remove or make sure it appears in the correct subdirectory of the classpath.
import core.data.UserPassword;
^
1 error
Are there any mistakes? If so tell me where is it and how to change them.Please help.I try it that way, but it don't compile.
Error:core\data\UserPassword.java:package javax.servlet does not exist
import javax.servlet.*;
core\data\UserPassword.java:package javax.servlet.http does not exist
import javax.servlet.http.*;
So,I comment them only in the UserPassword.java file,and compile it again.
Then it compile well.I goto the directory to get the .class files.
But there is only UserPassword.class inside the data folder. There is not
UserAccManager.class in the core folder.
Then I try this way,I put my 2 java files in to a new folder,
F:\SystemName\com
When I try it that way, but it don't compile.
javac -classpath . -d . com\*.javaError:com\UserPassword.java:package javax.servlet does not exist
import javax.servlet.*;
com\UserPassword.java:package javax.servlet.http does not exist
import javax.servlet.http.*;
So,I comment them only in the UserPassword.java file,and compile it again.
Now both are compiling well.There was 2 class files.
I put them in to the WEB-INF/classes/com directory.
Start the server.But it gave errors:
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:68: cannot resolve symbol
symbol : variable empno
location: class org.apache.jsp.CreateAcc_jsp
if(UserPassword.verifyEmpno(empno)){
^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: cannot resolve symbol
symbol : variable username
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.verifyUsername(username)){
^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: non-static method
verifyUsername(java.lang.String) cannot be referenced from a static context
if(UserAccManager.verifyUsername(username)){
^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
symbol : variable empno
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
symbol : variable username
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
symbol : variable password
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
symbol : variable level
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: non-static method
createAcc(int,java.lang.String,java.lang.String,int) cannot be referenced from a static
context
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
8 errorsTo solve the problem non-static method,I goto the UserAccManager.java file and do these
things.
package com;
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.sql.*;
//import javax.servlet.*; //otherwise it tells an error.(package
//javax.servlet does not exist)
//import javax.servlet.http.*;
public class UserAccManager {
private static final String DRIVER = "com.mysql.jdbc.Driver";
private static final String URL = "jdbc:mysql://localhost:3306/superfine";
private static Connection connection;
private static PreparedStatement pstmt1;
private static PreparedStatement pstmt2;
private static PreparedStatement pstmt3;
private UserAccManager() {
// Initializes the connection and statements
private static void initConnection() {
//same
// Closes the connection and statements
// Method to be called by main class when finished with DB
public static void closeConnection() {
//same
public static boolean verifyEmpno(int empno) {
// same.
public static boolean verifyUsername(String username) {
//same.
public static boolean createAcc(int empno, String username, String password, int
level){
//same
package com;
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.sql.*;
//import javax.servlet.*;
//import javax.servlet.http.*;
public class UserPassword {
// same
Again compile those files and put .class filses into the WEB-INF/classes/com directory.
When i submits the data via the form it generates an error:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:68: cannot resolve symbol
symbol : variable empno
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.verifyEmpno(empno)){
^
An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
Generated servlet error:
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: cannot resolve symbol
symbol : variable username
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.verifyUsername(username)){
^
An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
Generated servlet error:
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
symbol : variable empno
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
Generated servlet error:
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
symbol : variable username
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
Generated servlet error:
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
symbol : variable password
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
Generated servlet error:
C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
symbol : variable level
location: class org.apache.jsp.CreateAcc_jsp
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
^
6 errorshere is the CreateAcc.jsp file
<%@ page language="java" %>
<%@ page import="com.UserAccManager" %>
<%@ page import="com.UserPassword" %>
<jsp:useBean id="userPassword" class="com.UserPassword" scope="request"/>
<jsp:setProperty name="userPassword" property="*" />
<%
String nextPage ="MainForm.jsp";
if(UserAccManager.verifyEmpno(empno)){
if(UserAccManager.verifyUsername(username)){
if(UserAccManager.createAcc(empno, username,password,level)) nextPage
="MsgAcc.jsp";
}else{
nextPage="UserNameExist.jsp";
else{
nextPage="UserAccError.jsp";
%>
<jsp:forward page="<%=nextPage%>"/>Please, anyone know how to send these parameters to the java file.
Thanks. -
How can I set up breakpoints in eclipse for jsp?
I saw somebody can set up breakpoints in eclipse for jsp.
But I can not do that on my eclipse.
What's the difference?
Thanks.I don't think this had a keyboard shortcut even before (checked in CS6). There's an alternative though.
1. Create a JSFL file with following code and save it in the commands folder as 'Remove Tween'.
fl.getDocumentDOM().getTimeline().setFrameProperty('tweenType', 'none');
2. Now goto Edit Menu > Keyboard Shortcuts..
3. Search for 'Remove Tween' and assign a keyboard shortcut to it.
Now everytime you press the assigned key - jsfl script is executed which essentially removes the tween from selected frame. (works for Classic and Shape tween but not Motion Tweens) -
Any help appreciated jsp...
hi
ive got a problem regarding jsp.... for starters i cant even view the jsp examples on the tomcat index page....
the servlet examples run fine and i can create my own servlets as well..
but when i try to create my own simple jsp page or run the examples i get the following error...
"......The server encountered an internal error () that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null....blah blah ..."
ive got a feeling this is a set up related error ... im running xp
with j2sdk1.4.2 and tomcat 4.1
any help would be appreciated as i have to get jsp up and running pretty soon .....
thanks
markHi cram81,
It sounds strange that jsp examples are not working from a default install. I can only guess that your classpath is setup wrong.
Another possibility is that the .jar files in CATALINA_HOME/common/lib are not the correct ones for compiling the jsp files.
Tomcat will always look in the above folder when attempting to compile jsp files.
Servlet examples work because they are precompiled, where-as the server always compiles jsp's at runtime if it's the first time that you are running that jsp or a change has been made to it.
Usually the jsp examples fail to compile because of a classpath error.
Check it out and let me know how you get on. -
Unable to compile class for JSP. apache-tomcat-6. What could be wrong?
Hello, I am new to JSP and I am trying a very basic jsp and class file on Windows XP. I get the Unable to compile class for JSP.
Steps that I have done:
javac ch06_01.java , placed the ch06_01.class under
C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes
Then grabbed the ch06_02.jsp and placed it under
C:\Apps\apache-tomcat-6.0.16\webapps\ch06\
When I run it (by placing this into Explorer or Firefox URL
http://localhost:8080/ch06/ch06_02.jsp) I get the error further
below. Things I have done and made sure they are in place are:
set up JAVA_HOME to C:\Apps\jdk1.6.0_06
Using CATALINA_BASE: C:\Apps\apache-tomcat-6.0.16
Using CATALINA_HOME: C:\Apps\apache-tomcat-6.0.16
Using CATALINA_TMPDIR: C:\Apps\apache-tomcat-6.0.16\temp
Using JRE_HOME: C:\Apps\jre1.6.0_06
I did a google on the error and I found people saying to place the
tools.jar from the jsk into the lib directory under CATALINA_HOME. But
the examples still don't work. What step could I be missing? Your help is greatly
appreciated.
This is the simple jsp file:
<%@ page import="ch06_01" %>
<HTML>
<HEAD>
<TITLE>Using a JavaBean</TITLE>
</HEAD>
<BODY>
<H1>Using a JavaBean</H1>
<% ch06_01 messager = new ch06_01(); %>
The message is: <%= messager.msg() %>
</BODY>
</HTML>
this is the simple ch6_01 java file:
public class ch06_01
public ch06_01()
public String msg()
return "Hello from JSP!";
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 6 in the generated java file
The import ch06_01 cannot be resolved
An error occurred at line: 9 in the jsp file: /ch06_02.jsp
ch06_01 cannot be resolved to a type
6: <BODY>
7: <H1>Using a JavaBean</H1>
8:
9: <% ch06_01 messager = new ch06_01(); %>
10:
11: The message is: <%= messager.msg() %>
12:
An error occurred at line: 9 in the jsp file: /ch06_02.jsp
ch06_01 cannot be resolved to a type
6: <BODY>
7: <H1>Using a JavaBean</H1>
8:
9: <% ch06_01 messager = new ch06_01(); %>
10:
11: The message is: <%= messager.msg() %>
12:
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:316)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
Edited by: indikon1 on Jun 12, 2008 1:18 PM
I just updated the directories of the variables to reflect the current status of my system.What is wrong is that you are using an "old" jsp tutorial :-)
Since Java 1.4, JSPs have been unable to access classes in the "default" package.
What you need to do:
Put the java class ch06_01 in a package.
Steps to do this
- Edit ch06_01 and add the following to the very top of the file (without the quotes): "package mypackage;"
- create a folder "mypackage"
- move ch06_01.java into that folder
- compile that class (now in the mypackage package)
- place ch06_01.class under C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes\mypackage
In your jsp:
<%@ page import="mypackage.ch06_01" %>
I would suggest using a more up-to-date tutorial that uses JSTL.
Take a look at this [Apache Tomcat tutorial|http://www.coreservlets.com/Apache-Tomcat-Tutorial/index.html]
Maybe you are looking for
-
Adobe forms and interactive forms
Hi Friends, I am new to adobe forms. Can anybody explain in detail- 1) Why Adobe forms instead of smartforms. 2) Main use of Adobe forms. 3) How to become master in this technlogy. regards, phaneendra.
-
Hi, Can anyone tell me how to generate a fmx file... my fmb is in $AU_TOP/forms/US and the fmx file should go to $XXAR_TOP/forms/US This is the command I am using f60gen $AU_TOP/forms/US/ABC.fmb userid/password output_file = $XXAR_TOP/forms/US/ABC.fm
-
Error: CRM 7.0 WebClient "No Connector for Template"
Hi Guys Please help my..!! When I register with the role CRM: MKT_MAN, MKT_EMPL, SALES_EMPL, etc. I get the following error message: One or more entries in the central search menu have been omitted Entry for Accounts(BP_ACCOUNT/H): No Connector for
-
I just downloaded fan control because it sounds like a good idea to keep this puppy cool. What is a good setting that isn't going to be overkill. I don't want to compromise battery life too much. Anyone good with this program? This is for my MBP 15"
-
Search for Duplicates with different titles
Some of us ill organized users have thousands and even tens of thousands of pictures scanned in from old albums, 35mm slides, and shoe boxes full of loose pictures. The result is many duplicates with different names. In Elements one could search on '