Internationalization for JSP
I can't i18ned my JSPs pages. SJSS can find string in java but it can't find string between:
my texte <How internationalized HTML/JSP page with SJSS/NetBeans ?
The I18N support found in the Tools menu of Sun Java Studio or NetBeans is designed to help with I18N tediousness in a J2SE program.
Doing I18N in JSPs is a bit harder than in a J2SE program, since you want to base the text lookup not on the server's context, but on the client's context.
The following article does a good job of explaining how to do it: http://java.sun.com/developer/technicalArticles/Intl/MultilingualJSP/
Similar Messages
-
Internationalization for more than 2 countries
I created tiny application (http://01.sk/i18nP2.zip) with 4 locales (US, GERMANY, FRANCE, ITALY). It shows current session locale.
I placed button in the view which changes the locale of current user to next locale (US->DE->FR->IT->US).
However when I use full locale (language and country specified) it doesn't work - only 2 languages are shown correctly (button and label texts). Other 2 languages are shown in the locale which was active for this user at deployment time. English-US locale is always OK.
When I comment locale-switching code and ucomment other one which uses language-only locales (ENGLISH->GERMAN->FRENCH->ITALIAN) application can work correctly.
However I can't get country specific stuff like currency symbol/formatting (which is different for all countries using the same language).
Is it bug in WebDynPro 2.0.11 (200502210240) or SAP server (W32/INTEL 7.5.0 Build 019-121-082-363) or I just don't understand something?The link is for JSP internationalization. Part 2 is considering WebDynpro application but using such resource bundles requires for each text additional command in source code. My application is using automatic builtin system that replaces all static texts (my boss requires to use all builtin "systems" when available). This automatic system works fine when you working with languages. But it stops working when you specify country too (or when you use more than 1 non-english country).
-
How to fix 'class' or 'interface' expected for jsp
below is the stack trace
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
/home/sherali/.netbeans/5.5/apache-tomcat-5.5.17_base/work/Catalina/localhost/UVSDataSearch/org/apache/jsp/pager_002ddemo_jsp.java:7: 'class' or 'interface' expected
import java.util.*;
^
Generated servlet error:
/home/sherali/.netbeans/5.5/apache-tomcat-5.5.17_base/work/Catalina/localhost/UVSDataSearch/org/apache/jsp/pager_002ddemo_jsp.java:8: 'class' or 'interface' expected
import java.io.*;
^
2 errors
thanks a lot in advance.
my jsp is
<%@ page session="false" %>
<%@ page import="tauvex.*;" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<html>
<head>
<title>Tauvex Search Results</title>
<%
* Pager Tag Library
* Copyright (C) 2002 James Klicman <[email protected]>
* The latest release of this tag library can be found at
* http://jsptags.com/tags/navigation/pager/
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
%>
<style type="text/css">
A.nodec { text-decoration: none; }
</style>
</head>
<body bgcolor="#ffffff">
<%
String style = getParam(request, "style", "simple");
String position = getParam(request, "position", "top");
String index = getParam(request, "index", "center");
int maxPageItems = getParam(request, "maxPageItems", 3);
int maxIndexPages = getParam(request, "maxIndexPages", 3);
%>
<%
String query1=(String)request.getAttribute("query1");
String query=(String)request.getAttribute("query");
String ShowFile=(String)request.getAttribute("ShowFile");
String ShowRA=(String)request.getAttribute("ShowRA");
String ShowDEC=(String)request.getAttribute("ShowDEC");
String Telescope=(String)request.getAttribute("Telescope");
String ObservationDates=(String)request.getAttribute("ObservationDates");
String Filter=(String)request.getAttribute("Filter");
String RA=(String)request.getAttribute("RA");
String DEC=(String)request.getAttribute("DEC");
String DATE=(String)request.getAttribute("DATE");
String DATE1=(String)request.getAttribute("DATE1");
String Radious=(String)request.getAttribute("Radious");
String FILTER[]=(String[])request.getAttribute("FILTER");
String OrderBy1=(String)request.getAttribute("OrderBy1");
String OrderBy2=(String)request.getAttribute("OrderBy2");
String OrderBy3=(String)request.getAttribute("OrderBy3");
%>
<%
out.println("<form action=\"PlainSQLQuery\" method=POST>");
out.println("<textarea rows = 5 cols = 40 name=query id=\"query\">");
out.println(query);
out.println("</textarea>");
out.println("<input type = submit value = \"Submit\">");
out.println("<input type = reset value = \"Reset\">");
out.println("</form>");
%>
<center>
<table border="0" width="90%" cellpadding="4">
<tr>
<td colspan="2" align="left" valign="top">
<table border="0" cellspacing="2" cellpadding="0">
<tr><td>Max. Page Items </td>
<td><input type="text" size="4" name="maxPageItems" value="<%= maxPageItems %>" onChange="this.form.submit();"></td></tr>
<tr><td>Max. Index Pages </td>
<td><input type="text" size="4" name="maxIndexPages" value="<%= maxIndexPages %>" onChange="this.form.submit();"></td></tr>
</table>
</td>
</tr>
</table>
<pg:pager
index="<%= index %>"
maxPageItems="<%= maxPageItems %>"
maxIndexPages="<%= maxIndexPages %>"
url="TauvexDataServlet"
export="offset,currentPageNumber=pageNumber"
scope="request">
<%-- keep track of preference --%>
<pg:param name="style"/>
<pg:param name="position"/>
<pg:param name="index"/>
<pg:param name="maxPageItems"/>
<pg:param name="maxIndexPages"/>
<pg:param name="RA"/>
<pg:param name="DEC"/>
<pg:param name="DATE"/>
<pg:param name="DATE1"/>
<pg:param name="Radious"/>
<pg:param name="FILTER"/>
<pg:param name="ShowRA"/>
<pg:param name="ShowDEC"/>
<pg:param name="Telescope"/>
<pg:param name="ObservationDates"/>
<pg:param name="Filter"/>
<pg:param name="OrderBy1"/>
<pg:param name="OrderBy2"/>
<pg:param name="OrderBy3"/>
<%-- save pager offset during form changes --%>
<input type="hidden" name="pager.offset" value="<%= offset %>">
<%-- warn if offset is not a multiple of maxPageItems --%>
<% if (offset.intValue() % maxPageItems != 0 &&
("alltheweb".equals(style) || "lycos".equals(style)) )
%>
<p>Warning: The current page offset is not a multiple of Max. Page Items.
<br>Please
<pg:first><a href="<%= pageUrl %>">return to the first page</a></pg:first>
if any displayed range numbers appear incorrect.</p>
<% } %>
<%-- the pg:pager items attribute must be set to the total number of
items for index before items to work properly --%>
<% if ("top".equals(position) || "both".equals(position)) { %>
<br>
<pg:index>
<% if ("texticon".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/texticon.jsp" flush="true"/>
<% } else if ("jsptags".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/jsptags.jsp" flush="true"/>
<% } else if ("google".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/google.jsp" flush="true"/>
<% } else if ("altavista".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/altavista.jsp" flush="true"/>
<% } else if ("lycos".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/lycos.jsp" flush="true"/>
<% } else if ("yahoo".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/yahoo.jsp" flush="true"/>
<% } else if ("alltheweb".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/alltheweb.jsp" flush="true"/>
<% } else { %>
<jsp:include page="/WEB-INF/jsp/simple.jsp" flush="true"/>
<% } %>
</pg:index>
<% } %>
<hr>
<form action="ZipServlet" method="get" name="download" onsubmit="return Form1_Validator(this)">
<table id="output">
<CAPTION><EM>Fits file Search Results</EM></CAPTION><tr>
<%
out.println("<th>Check Box</th>");
out.println("<th>File Name</th>");
if(ShowRA != null && "on".equals(ShowRA))
out.println("<th>RA_START</th>");
if(ShowRA != null && "on".equals(ShowRA))
out.println("<th>RA_END</th>");
if(ShowDEC != null && "on".equals(ShowDEC))
out.println("<th>DEC_START</th>");
if(ShowDEC != null && "on".equals(ShowDEC))
out.println("<th>DEC_END</th>");
if(Telescope!=null && "on".equals(Telescope))
out.println("<th>Telescope</th>");
if(ObservationDates !=null && "on".equals(ObservationDates))
out.println("<th>STARTOBS</th>");
if(ObservationDates !=null && "on".equals(ObservationDates))
out.println("<th>ENDOBS</th>");
if(Filter!=null && "on".equals(Filter))
out.println("<th>FILTER</th>");
out.println("</tr>");
%>
<%--
<table width="90%" cellspacing="4" cellpadding="4">
Since the data source is static, it's easy to offset and limit the
loop for efficiency. If the data set size is not known or cannot
be easily offset, the pager tag library can count the items and display
the correct subset for you.
The following is an example using an enumeration data source of
unknown size. The pg:pager items and isOffset attributes must
not be set for this example:
--%>
<%
Enumeration myDataList1 = (Enumeration)request.getAttribute("myDataList1");
if (myDataList1 == null)
throw new RuntimeException("myDataList1 is null");
%>
<% while (myDataList1.hasMoreElements()) { %>
<% TauvexData elem = (TauvexData)myDataList1.nextElement(); %>
<pg:item> <%
out.println("<tr>");
%>
<td><input type= "checkbox" name="cb" value="<%=elem.getDownload()%>"></td>
<td><a href="<%= elem.getDownload() %>"><%= elem.Fitsfilename %></a></td>
<%
// out.println("<td> "+elem.Fitsfilename+" </td>");
if(ShowRA != null && "on".equals(ShowRA))
out.println("<td> "+elem.RA_START+" </td>");
if(ShowRA != null && "on".equals(ShowRA))
out.println("<td> "+elem.RA_END+"</td>");
if(ShowDEC != null && "on".equals(ShowDEC))
out.println("<td> "+elem.DEC_START+" </td>");
if(ShowDEC != null && "on".equals(ShowDEC))
out.println("<td> "+elem.DEC_END+" </td>");
if(Telescope!=null && "on".equals(Telescope))
out.println("<td> "+elem.telescope+" </td>");
if(ObservationDates !=null && "on".equals(ObservationDates))
out.println("<td> "+elem.STARTOBS+" </td>");
if(ObservationDates !=null && "on".equals(ObservationDates))
out.println(" <td> "+elem.ENDOBS+" </td>");
if(Filter!=null && "on".equals(Filter))
out.println("<td> "+elem.FILTER+" </td>");
out.println("</tr>");
%> </pg:item>
<% } %>
</table>
<input type="button" name="CheckAll" value="Check All Boxes" onclick="modify_boxes(true,3)">
<input type="button" name="UnCheckAll" value="UnCheck All Boxes" onclick="modify_boxes(false,3)">
<input type="submit" value="Download">
</form>
<hr>
<pg:pages>
<a href="<%= pageUrl %>"><%= pageNumber %></a>
</pg:pages>
<pg:last>
<a href="<%= pageUrl %>">[ Last >| (<%= pageNumber %>) ]</a>
</pg:last>
<% if ("bottom".equals(position) || "both".equals(position)) { %>
<pg:index>
<% if ("texticon".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/texticon.jsp" flush="true"/>
<% } else if ("jsptags".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/jsptags.jsp" flush="true"/>
<% } else if ("google".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/google.jsp" flush="true"/>
<% } else if ("altavista".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/altavista.jsp" flush="true"/>
<% } else if ("lycos".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/lycos.jsp" flush="true"/>
<% } else if ("yahoo".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/yahoo.jsp" flush="true"/>
<% } else if ("alltheweb".equals(style)) { %>
<jsp:include page="/WEB-INF/jsp/alltheweb.jsp" flush="true"/>
<% } else { %>
<jsp:include page="/WEB-INF/jsp/simple.jsp" flush="true"/>
<% } %>
</pg:index>
<% } %>
</pg:pager>
</center>
</body>
</html>
<%!
private static int num =1;
private static String getName(){
String str="cb";
str=str+num;
num++;
return str ;
private static final String getParam(ServletRequest request, String name,
String defval)
String param = request.getParameter(name);
return (param != null ? param : defval);
private static final int getParam(ServletRequest request, String name,
int defval)
String param = request.getParameter(name);
int value = defval;
if (param != null) {
try { value = Integer.parseInt(param); }
catch (NumberFormatException ignore) { }
return value;
private static void radio(PageContext pc, String name, String value,
boolean isDefault) throws java.io.IOException
JspWriter out = pc.getOut();
String param = pc.getRequest().getParameter(name);
out.write("<input type=\"radio\" name=\"");
out.write(name);
out.write("\" value=\"");
out.write(value);
out.write("\" onChange=\"this.form.submit();\"");
if (value.equals(param) || (isDefault && param == null))
out.write(" checked");
out.write('>');
%>Well, putting all that Java code into a JSP was a bad idea in the first place, just on general design principles. But you've done it in such a way that the result of compiling the JSP is malformed Java code. Frankly I would just throw it away and put the Java code into a servlet or some other Java class, where it belongs.
But if you're really working in a place where nobody has learned anything since 2003, and you're forced to support that old junk, then I would point out that the error occurs before the place which generates this line:
import java.util.*;You only need to look at two of the thousand lines of code you posted. -
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) -
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] -
Unable to compil class for jsp
error is
HTTP Status 500 -
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
Syntax error on token ".", Identifier expected after this token
An error occurred at line: 7 in the generated java file
Syntax error on token ".", Identifier expected after this token
An error occurred at line: 9 in the jsp file: /travel/issue.jsp
LibraryStudent cannot be resolved to a type
6: <BODY>
7: <H1>issue books</H1>
8: <CENTER>
9: <jsp:useBean id="student"
10: type="LibraryStudent"
11: scope="session" />
12: student name:
An error occurred at line: 9 in the jsp file: /travel/issue.jsp
LibraryStudent cannot be resolved to a type
6: <BODY>
7: <H1>issue books</H1>
8: <CENTER>
9: <jsp:useBean id="student"
10: type="LibraryStudent"
11: scope="session" />
12: student name:
An error occurred at line: 13 in the jsp file: /travel/issue.jsp
LibraryStudent cannot be resolved to a type
10: type="LibraryStudent"
11: scope="session" />
12: student name:
13: <jsp:getProperty name="student" property="studentName" />
14:
15: book name:
16: <jsp:getProperty name="student" property="bookName" />
An error occurred at line: 16 in the jsp file: /travel/issue.jsp
LibraryStudent cannot be resolved to a type
13: <jsp:getProperty name="student" property="studentName" />
14:
15: book name:
16: <jsp:getProperty name="student" property="bookName" />
17:
18: <jsp:getProperty name="student"
19: property="issueData" />
An error occurred at line: 18 in the jsp file: /travel/issue.jsp
LibraryStudent cannot be resolved to a type
15: book name:
16: <jsp:getProperty name="student" property="bookName" />
17:
18: <jsp:getProperty name="student"
19: property="issueData" />
20: </FORM>
21: </CENTER>LibraryStudent.java is
import java.util.*;
import java.text.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;
public class LibraryStudent {
private String emailAddress, s,password, sname,bname;
private String date,value;
public String getStudentName() {
return(sname);
public void setStudentName(String sname) {
this.sname = sname;
public String getEmailAddress() {
return(emailAddress);
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
public String getPassword() {
return(password);
public void setPassword(String password) {
this.password = password;
public String getBookName() {
return(bname);
public void setBookName(String bname) {
this.bname = bname;
public String getDate() {
return(date);
public void setDate(String date) {
this.date = date;
public String getIssueData() //method that create connection withh database
throws ServletException,IOException{
try{
getDate(); //and add a entry in database
getBookName();
getStudentName();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:db2");
Statement st=con.createStatement();
String sql =
"insert into table1 (bookname,studentname,date) values(bname,sname,date)";
st.executeUpdate(sql);
System.out.println(sql);
String s= "your book has been issued ";
return(s);
catch(Exception e)
e.printStackTrace();
return "failed";
public String getSumbitData()
throws ServletException,IOException{
try
getBookName();
getStudentName();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:db2");
Statement st=con.createStatement();
String sql =
"delete from db2 where bookname='bname' and studentname=sname";
st.executeUpdate(sql);
System.out.println(sql);
String s="your book has been sumbitted ";
return(s) ;
catch(Exception e)
e.printStackTrace();
return "failed";
public static int findStudent //to validate customer
(String emailAddress,
String password) throws ServletException,IOException{
try
if (emailAddress == null) {
return(0);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:user");
Statement st=con.createStatement();
String sql="select * from user where name='"+emailAddress+"' and password='"+password+"'";
System.out.println(sql);
ResultSet rs=st.executeQuery(sql);
if(rs.next())
return(1);
else
return(0);
}catch(Exception e)
e.printStackTrace();
return (0);}
to be continued.............and Library.java is import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Library extends HttpServlet {
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String emailAddress = request.getParameter("emailAddress");//use to email&pass
String password = request.getParameter("password");//from html page
LibraryStudent student = new LibraryStudent();//Make a student Object
int a=LibraryStudent.findStudent(emailAddress, password);//to validate student
if (a==0) {
gotoPage("/library/accounts.jsp", request, response);
else
student.setStudentName(request.getParameter("sname"));//use to sent other textbox
student.setBookName(request.getParameter("bname"));//data in librarystudent
student.setDate(request.getParameter("date"));//class after validation
HttpSession session = request.getSession(true);
session.putValue("student", student);
//for moving different page
if (request.getParameter("issue") != null) {
gotoPage("/travel/issue.jsp",
request, response);
} else if (request.getParameter("sumbit") != null) {
gotoPage("/travel/sumbit.jsp",
request, response);
} else if (request.getParameter("search") != null) {
gotoPage("/travel/search.jsp",
request, response);
} else if (request.getParameter("account") != null) {
gotoPage("/travel/EditAccounts.jsp",
request, response);
} else {
gotoPage("/travel/IllegalRequest.jsp",
request, response);
private void gotoPage(String address,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(address);
dispatcher.forward(request, response);
} issue.jsp is
<%@page import="java.io.,java.util.,java.sql.*"%>
<HTML>
<HEAD>
<TITLE>issue books</TITLE>
</HEAD>
<BODY>
<H1>issue books</H1>
<CENTER>
<jsp:useBean id="student"
type="LibraryStudent"
scope="session" />
student name:
<jsp:getProperty name="student" property="studentName" />
book name:
<jsp:getProperty name="student" property="bookName" />
<jsp:getProperty name="student"
property="issueData" />
</FORM>
</CENTER>
</BODY>
</HTML> plz solve my problem .i m new to servlet and jsp and i have keen desire to learn this topic -
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. -
Hi,
we are trying to set define ACL for weblogic security for JSP
and could't manage to do it. In the online documentation there
are examples for servlets but not for html or jsp files.
How have to be defined the ACLs for jsp and html files ?
Thanks in advance.
GRIDSYSTEMS Bartolome Real Planells
See http://www.weblogic.com/docs51/admindocs/properties.html#urlacl for
details on setting ACLs on URLs...
Bartolome Real Planells wrote:
> Hi,
>
> we are trying to set define ACL for weblogic security for JSP
> and could't manage to do it. In the online documentation there
> are examples for servlets but not for html or jsp files.
>
> How have to be defined the ACLs for jsp and html files ?
>
> Thanks in advance.
>
> -------------------------------------------------------------------
> GRIDSYSTEMS Bartolome Real Planells
-
Design view for jsp custom tags.
when we drag-and-drop custom tag control in the source of jsp page, when we switch to the design view of jsp we should be able to view controls as desired.
Observation: 1) Eclipse 3.2 doesn't have design view for jsp pages.
2) which software uses the design view. we need to extend eclipse core framework and we do not find any technical approach document to proceed further on this.
3) RAD 6.0 we can see a JSP in design view.
I'm searching for any technical approach document to create plugin that can intercept the custom tags and provide a design view.
Will any one suggest the plugin for that.Jeff,
I have checked with engineering and found that JSP Design View support on
Linux is a planned feature for the next release. I don't think we will have
this feature as part of a Service Pack for 8.1
Regards,
Raj Alagumalai
WebLogic Workshop Support
"Jeff Cassanvoa" <[email protected]> wrote in message
news:3f4df04e$[email protected]..
>
Raj,
Thanks for the information!! Any timeframe when it might be supportedon Linux
Thanks,
Jeff
"Raj Alagumalai" <[email protected]> wrote:
Jess,
Unfortunately, the JSP design view is currently not supported on Linux.
Workshop does allow to do remote development where the IDE is running
on a
Windows machine and connects to a server running on Linux/Solaris.
Regards,
Raj Alagumalai
WebLogic Workshop Support
"Jeff Cassanova" <[email protected]> wrote in message
news:[email protected]..
Does anybody else who is running the Linux version of Workshop 8.1have
troubling
getting the Design View of JSP files to come up. All I see is thesource,
with
no tabs at the bottom to switch to/from the Design View. When I bootover
to
Windows and run 8.1 Workshop, I see both tabs and I am able to useboth
views.
Is it something I have set in Preferences somewhere that disablesthe
Design
View ???
Thanks,
Jeff -
Tomcat 4.1 Bean error (Unable to compile class for JSP)
Help,
I am using Tomcat 4.1 with with JDK1.3.1_01. I have a JSP page in which I try to use a Bean, but I get the following error from Tomcat.
The JSP page is very simple. I am using package names in the import statement. Code below.
I've put the class files under
<TOMCAT>\webapps\projectname\WEB-INF\classes under the appropriate packages. What else is missing? I can not figure out what I am doing wrong.
***************** START JSP CODE *********************
<html>
<head>
<title>User Information</title>
</head>
<%@ page session="true" %>
<%@ page import="com.xxx.yyy.data.*" %>
<body>
<P> </P>
<P> </P>
<P> </P>
<!--
<jsp:useBean id="user" class="com.xxx.yyy.data.User" scope="session"/>
-->
<%
User user = (User) session.getAttribute("user");
%>
UserID = <%= user.getUserID() %><BR>
User Name = <%= user.getUserName() %><BR>
Password = <%= user.getPassword() %><BR>
Password Hint = <%= user.getPasswordHint() %><BR>
</body>
</html>
***************** END JSP CODE *********************
***************** START TOMCAT ERROR MESSAGE *********************
org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:477)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:182)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 20 in the jsp file: /userInfo.jsp
Generated servlet error:
[javac] Compiling 1 source file
D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:7: package com.xxx.yyy.data does not exist
import com.xxx.yyy.data.*;
^
D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:61: package com.xxx.yyy.data does not exist
com.xxx.yyy.data.User user = null;
^
An error occurred at line: 20 in the jsp file: /userInfo.jsp
Generated servlet error:
D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:63: package com.xxx.yyy.data does not exist
user = (com.xxx.yyy.data.User) pageContext.getAttribute("user", PageContext.SESSION_SCOPE);
^
An error occurred at line: 20 in the jsp file: /userInfo.jsp
Generated servlet error:
D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:66: package com.xxx.yyy.data does not exist
user = (com.xxx.yyy.data.User) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.xxx.yyy.data.User");
^
An error occurred at line: 25 in the jsp file: /userInfo.jsp
Generated servlet error:
D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:77: cannot resolve symbol
symbol : class User
location: class org.apache.jsp.userInfo_jsp
User user = (User) session.getAttribute("user");
^
An error occurred at line: 25 in the jsp file: /userInfo.jsp
Generated servlet error:
D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:77: cannot resolve symbol
symbol : class User
location: class org.apache.jsp.userInfo_jsp
User user = (User) session.getAttribute("user");
^
6 errors
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:315)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:326)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:182)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)
***************** END TOMCAT ERROR MESSAGE *********************Hi
I am running my Tomcat apps (on a Windows dev machine) in an alternate location (ie. not default webapps). The same crap comes to me every time. Unable to install etc. I have tried every trick in the book regarding classpath settings etc.
When I use 'javap' to check the classpath from any location on my machine, its works and javap returns the signature of my class.
When I use it though Tomcat (with the import set to include the filename), it get the error. I have heard rumors that using JDK 1.3 in stead of 1.4 helps, but I just want it to work with 1.4 :)
So if any of you can help me on this, please.
PS. On my linux server it works just fine, as does every other thing on that machine ;)
Chris (chris.schuit <at> euronet.nl) -
How to set default encoding and charsets for jsp and servlets.
Hi,
Is there any possibility to set default encoding or charset for jsps and servlest (for both request and response)?
For example in Weblogic such parameters can be set in weblogic specific configuration files (weblogic.xml).
Thanks in advance.Hi,
I created one request with logo in the header an page in the footer etc. and called StyleSheet. After you can import this formats by each request.
You can do this in compound layout.
Regards,
Stefan -
Internationalization for Hebrew language
hi,
I made an application, internationalized to be used with some different languages.
Til now I internationalized it only for languages that have Latin letters (ISO/IEC 10646-1)
and in this way it is working fine...
Recently I had a request to put it in Hebrew language, that doesn't use Latin characters.
Reading the documentation, I implemented the localization for the Hebrew language in the
follow way:
Someone wrote the words in Hebrew characters inside a property file (file_iw_IL.properties) ,
afterwards I transformed the Hebrew characters in the UTF-16 mode "\uxxxx", using the
native2ascii tool that come with jdk ....
But when the application for the Hebrew language run, it didn't work...
I should like to know if the procedure that I did for Hebrew
internationalization is right and, if is not, I would like to know what is the right precedure
to make internationalization for languages that don't have Latin characters.
thank you in advance for a kind help
regards
tonyMrsangeloNo one answer me so I try again for some help, explain better my problem.
I use this class to get strings in different languages:
public class SupplierOfInternationalizedStrings {
Locale localUsedIt;
Locale localUsedEn;
Locale localUsedHe;
Locale localizedCurrencyFormat;
Locale localUsedHere;
public SupplierOfInternationalizedStrings() { // constructor
localUsedIt = new Locale("it", "IT"); // specifica il file appartenente alla famiglia
localUsedEn = new Locale("en", "US"); // specifica il file appartenente alla famiglia
localUsedHe = new Locale("he", "HE"); // specifica il file appartenente alla famiglia
} // constructor
void setInternationalizationCountry(String langToUse) {
if (langToUse.compareToIgnoreCase("Italiano") == 0) {
localUsedHere = localUsedIt;
localizedCurrencyFormat = new Locale("it", "IT");
} else if (langToUse.compareToIgnoreCase("English") == 0) {
localUsedHere = localUsedEn;
localizedCurrencyFormat = new Locale("iw", "IL");
} else if (langToUse.compareToIgnoreCase("Hebrew")== 0) {
localUsedHere = localUsedHe;
localizedCurrencyFormat = new Locale("iw", "IL");
System.out.println("linguaggio impostato = " + localUsedHere);
} // initializeInternationalization()
public String getInternationalString(String keyForTheWord) {
ResourceBundle resourceBund = ResourceBundle.getBundle("properiesFile", // il nome del file .properties... la famiglia dei files
localUsedHere);
String word = resourceBund.getString(keyForTheWord);
return word;
} // getStringForMedidentStartClass()
} // class SupplierOfInternationalizedStringsOf course I have a file.property iw_IL - Hebrew (Israel) where for each key there is a value wrote with hebrew characters
the hebrew file property look in this way:
keyForLabel1= ה עברית מילה שתימ \n
keyForLabel2=ספה עברית מילה שתימ The class SupplierOfInternationalizedStrings works for the translation in english and in other languages that use latins letters ..,
but when it is setted for be used with the Hebrew language ( localUsedHere = localUsedHe)
the metod getInternationalString() don't return Hebrew words.
This didn't worry me, because I read in the documentation that properies file cannot
read characters that are different from latine... and I also learned that in this case it need to convert the letters
in Unicode format...
I made this work putting the hebrew words in an .rtf file and, using native2ascii utility
with the command native2ascii -encoding UTF8 file.rtf textdoc.txt, I got the unicode format.
Now the file property for Hebrew language looks in this way:
keyForLabel1 = \u00d4 \u00e2\u00d1\u00e8\u00d9\u00ea...
keyForLabel2 = \u00e1\u00e4\u00d4 \u00e2\u00d1.....At this point I expected the translation in Hebrew comes good... but instead I still I cannot get the Hebrew words..
I should like to know why the elaboration still doesn't works
and I would have too some help in order to do the program works good.
thank you
regards
tonyMrsangelo -
Org.apache.jasper.JasperException: Unable to compile class for JSP
Hi All,
I have been using NetBeans IDE 3.5.1. AndI am trying to execute one JSP file, but it is giving error and i am not able to execute the servlet files also in NetBeans IDE. Can anybody help me out regarding this...
type - Exception report
message - Internal Server Error
description - The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception -
org.apache.jasper.JasperException: Unable to compile class for JSP
C:\Documents and Settings\kiran\.netbeans\3.5\tomcat406_base\work\Tomcat-Internal\localhost\C_3A_5CDocuments+and+Settings_5Ckiran_5CNetBeans+IDE+3.5.1_5Ctomcat406_5Cwebapps_5Cctm\jsp1\AdminClient$jsp.java:5: Package login not found in import.
import login.*;
^
C:\Documents and Settings\kiran\.netbeans\3.5\tomcat406_base\work\Tomcat-Internal\localhost\C_3A_5CDocuments+and+Settings_5Ckiran_5CNetBeans+IDE+3.5.1_5Ctomcat406_5Cwebapps_5Cctm\jsp1\AdminClient$jsp.java:7: Package javax.ejb not found in import.
import javax.ejb.*;
^
2 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.loadJSP(IDEJspServlet.java:442)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.loadIfNecessary(IDEJspServlet.java:148)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:160)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:226)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:484)The page is located at web/test/test.jsp and the java as below
Is there anything still need to add to test.jsp?
DB.java (web/classes/DB/db.class)
package DB;
import java.sql.*;
public class db
String db_url="jdbc:mysql://localhost:3306/DB";
String db_user="root";
String db_password="123456";
private ResultSet r=null;
static private ResultSet res=null;
int staff_Id=0;
/** Creates a new instance of db */
public int getRetrieveId()
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch (Exception E)
E.printStackTrace();
try{
Connection C = DriverManager.getConnection(db_url,db_user,db_password);
Statement S = C.createStatement();
r = S.executeQuery("select max(staff_Id) from staff");
while(r.next()){
staff_Id=r.getInt(1);
S.close();
C.close();
catch(Exception e)
e.printStackTrace();
return staff_Id;
public static boolean getSearch(String s)
String search_db_url="jdbc:mysql://localhost:3306/DB";
String search_db_user="root";
String search_db_password="123456";
String str=null;
boolean result=false;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch (Exception E)
E.printStackTrace();
try{
Connection C = DriverManager.getConnection(search_db_url,search_db_user,search_db_password);
Statement S = C.createStatement();
res = S.executeQuery(s);
while(res.next()){
str=res.getString(1);
if(!str.equals(null))
result=true;
S.close();
C.close();
catch(Exception e)
e.printStackTrace();
return result;
public void setUpdate(String str)
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch (Exception E)
E.printStackTrace();
try{
Connection C = DriverManager.getConnection(db_url,db_user,db_password);
Statement S = C.createStatement();
int r = S.executeUpdate(str);
S.close();
C.close();
catch(Exception e)
e.printStackTrace();
}
Maybe you are looking for
-
How to add a calendar option on my prompt in answers
Hello, In one of the reports I am creating; I need to enable end-users to select a date as well as time when the transaction took place. For instance on the side of 'Void Date' I wanna put a calendar sign/icon where they can select the date and time.
-
hi all i need the z program code for printing pr that is ME51n and also the code for the z prorgram for price comparision list me49
-
BADI for Me21N - Condition types
Hi All, wat ever condition type given in the header should be copied to all the items in the item level. then they want to change the condition type at item level for one or two items rest all are same like header condition types. see we have a condi
-
Firefox versions change too fast.
Some development-tools refer to HTML/CSS features that work in certain version, but with 1 major-verions per 6 weeks we are at version 16 in one year. No tool will provide glue what CSS level can be expected to work in which version. For example "WeB
-
I am having an issue when using safari. My screen goes from really large to normal. The screen also disappears and I get to the desktop with the small screens on top. Then I get the dock (I believe) with the calendar, time, weather, ect. Mouse goes c