Problems with JSP Extensions
Hi all,
I am having a prolbem running the 'quote' JSP extension example that ships
with WLS 5.1. I'm running 5.1, with service pack 3 (although the problem
occurs with or without the sp), on NT.
It seems to find the taglib, but it is saying that the taglib isn't valid.
Could there be something wrong with the DOCTYPE that the example ships with?
It looks like:
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd>
This also happens with the 'session' example, so I'm guess that I'm doing
something wrong, but I'm really not sure what that is.
If anyone has any ideas what I'm missing here, it would be appreciated.
Thanks.
Here is the exception I'm getting:
java.io.IOException: cannot resolve '/weblogic/taglib/quote' into a valid
tag li
brary
at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:94)
at
weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java, C
ompiled Code)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java,
Compil
ed Code)
at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java, Compiled
Code
at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1669)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1510)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
Code)
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
Code)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:115)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
mpiled Code)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
Code)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:186)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:117)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:141)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:744)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:692)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:251)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:363)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
Fri Jun 23 16:37:09 EDT 2000:<E> <ServletContext-General> Root cause of
ServletE
xception
weblogic.utils.ParsingException: nested IOException: java.io.IOException:
cannot
resolve '/weblogic/taglib/quote' into a valid tag library
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
Code)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:115)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
mpiled Code)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
Code)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:186)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:117)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:141)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:744)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:692)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:251)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:363)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
Hans Bure
I just figured this out by looking at console.war. If your web.xml says
<taglib-uri>blah.jar</taglib-uri>
<taglib-location>WEB-INF/blah.tld</taglib-location>
try
<%@ taglib uri="blah.tld" prefix="blah" @>
Note ".tld" at the URI. This must be an error.
"Alvin " <[email protected]> wrote:
>
>I am using wls5.10sp6, but I got exact the same Problems. I have no idea why this could happen. Can any guru give me a hint?
>Thanks.
>
>Alvin
>
>"Hans Bure" <[email protected]> wrote:
>>Hi all,
>>
>>I am having a prolbem running the 'quote' JSP extension example that ships
>>with WLS 5.1. I'm running 5.1, with service pack 3 (although the problem
>>occurs with or without the sp), on NT.
>>
>>It seems to find the taglib, but it is saying that the taglib isn't valid.
>>Could there be something wrong with the DOCTYPE that the example ships with?
>>It looks like:
>>
>><!DOCTYPE taglib
>> PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
>>"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd>
>>
>>This also happens with the 'session' example, so I'm guess that I'm doing
>>something wrong, but I'm really not sure what that is.
>>
>>If anyone has any ideas what I'm missing here, it would be appreciated.
>>Thanks.
>>
>>Here is the exception I'm getting:
>>
>>
>>
>>java.io.IOException: cannot resolve '/weblogic/taglib/quote' into a valid
>>tag li
>>brary
>> at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:94)
>> at
>>weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java, C
>>ompiled Code)
>> at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java,
>>Compil
>>ed Code)
>> at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java, Compiled
>>Code
>>)
>> at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1669)
>> at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1510)
>> at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
>>Code)
>>
>> at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
>> at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
>>Code)
>> at weblogic.servlet.jsp.JspParser.parse(JspParser.java:115)
>> at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
>> at
>>weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
>>mpiled Code)
>> at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
>>Code)
>>
>> at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
>> at
>>weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
>>java:186)
>> at
>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
>>pl.java:117)
>> at
>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
>>pl.java:141)
>> at
>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
>>textImpl.java:744)
>> at
>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
>>textImpl.java:692)
>> at
>>weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
>>ContextManager.java:251)
>> at
>>weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
>>a:363)
>> at
>>weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
>>
>> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
>>Code)
>>Fri Jun 23 16:37:09 EDT 2000:<E> <ServletContext-General> Root cause of
>>ServletE
>>xception
>>weblogic.utils.ParsingException: nested IOException: java.io.IOException:
>>cannot
>>resolve '/weblogic/taglib/quote' into a valid tag library
>> at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
>> at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled
>>Code)
>> at weblogic.servlet.jsp.JspParser.parse(JspParser.java:115)
>> at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
>> at
>>weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java, Co
>>mpiled Code)
>> at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
>>Code)
>>
>> at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
>> at
>>weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
>>java:186)
>> at
>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
>>pl.java:117)
>> at
>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
>>pl.java:141)
>> at
>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
>>textImpl.java:744)
>> at
>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
>>textImpl.java:692)
>> at
>>weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
>>ContextManager.java:251)
>> at
>>weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
>>a:363)
>> at
>>weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
>>
>> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
>>Code)
>>
>>
>>
>>Hans Bure
>>
>>
>>
>>
>
Similar Messages
-
Problem with upgrade Extension Manager 6.0.4
Problem with upgrade Extension Manager 6.0.4, code error U44M1P7
What version of the Adobe Application Manager are you using? Which operating system are you using?
-
I have seen several references to this problem on this forum but no real solution on any of the pages I have found. My jsp, which right now is no more than a static HTML page with jsp as the extension so that I can add the java code later, will not display in firefox it only shows the source code when I go to my website. Some example code is below.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>
Sichutech.com
</title>
<link rel="stylesheet" href="theme/NewMaster.css" type="text/css">
</head>
<body>
<div class="spacer"> </div>
<div id="banner" align="left">
<img src="images/logocropped.png">
</div>
<br class="clearboth">
<div class="spacer"> </div>
<div id="row1col1" align="left">
<img src="images/home.png"><br>
<img src="images/mission.png"><br>
<img src="images/about.png"><br>
<img src="images/services.png"><br>
<img src="images/contactus.png">
</div>
<div id="row1col2" align="left">
<img src="images/worldwide.png"><br><br>
<p>
<b>Stand alone application development:</b><br><br>
We provide stand-alone application development for businesses of any size.
Our applications are developed in Java using best standards and practices.
</p>
<p>
<b>Web Development:</b><br><br>
We provide custom web development for businesses of any size. We use J2EE
technologies to develope all web applications. These technologies consist
of Java, Javascript, Java Beans, HTML, JSP, XML, and other technologies as
applicable.
</p>
<p>
<b>Questions:</b><br><br>
For a quote on a custom stand-alone or web application to meet your business
needs please contact us through the contact us page.
</p>
</div>
<br class="clearboth">
<div class="spacer"> </div>
<div id="footer">
Home
Mission
About Us
Services
Contact Us
•
Copyright © Sichutech 2008 All Rights Reserved
</div>
<br class="clearboth">
</body>
</html>
The website is up and running and displays fine in IE but not firefox. The site address is www.sichutech.com
Any help is greatly appreciated.
Thanks,
RobertHere is what I see at the response headers:
Date: Wed, 06 Aug 2008 02:37:52 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8b DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 mod_jk/1.2.25 mod_perl/2.0.4 Perl/v5.8.8
Last-Modified: Mon, 04 Aug 2008 22:42:24 GMT
Etag: "aa0088-602-453aa0d911400"
Accept-Ranges: bytes
Content-Length: 1538
Content-Type: text/plain
X-Antivirus: avast! 4
X-Antivirus-Status: Clean
200 OKNote the content type: it is text/plain instead of text/html. And FireFox interpreted it correctly as text/plain. -
Cookie Problem With JSP and Tomcat
I have a tiny web application developed for my project thing.
I am facing a problem while maintaining sessions with Cookie. I use Tomcat 3.2.1 Web Server and JSP 1.2 Specifications for my web application.
I have created a page which creates a cookie and stores it in the client's PC, so when the same client visits the site, he can be remembered. Now while surfing the site in the same session, the site remembers the client. But once the client closes the browser and tries connecting to the site, he cannot be remembered. So I took a look into Temporary Internet Files of the client PC and found no cookie there. So where the cookie gets created and why does it disappears with the session. I have set a time limit of 1 year in the cookie.
Now is that a Problem with Tomcat or with the configuration settings of IE in the client PC?? Or something else???
Reply me Soon...Thanks for your reply.
following is the code for how do i create a cookie...
<%
String custno = custBean.createPreferred();
Cookie c = new Cookie("pc", custno);
c.setVersion(1);
c.setPath("/");
c.setComment("PreferredCustomer");
c.setDomain("think_machine");
//think_machine is the name of the Web Server(Tomcat)
c.setMaxAge(365*24*60*60);
response.addCookie(c);
%>
And the code to read a cookie is..
String custID = null;
Cookie[] cookies = request.getCookies();
for(int i = 0; i < cookies.length; i++)
if(cookies.getName().equals("pc"))
custID = cookies[i].getValue();
break;
One more thing I would like to let you know, that i access this from the same PC on which the Web Server is installed. Means the Server and the client are both one and the same PC. -
Having Problem with JSP In Netscape!HELP!!!
HI to all! I�m having problem with the jsp that i have :( If i use the Internet explorer it works but at Netscape... it doesn�t work :( The value of "PTE" is null... I need help !!!Please! I think the HTML IS NOT HELPING ...
the code is :
<html>
<head>
<!--tp001_transferencias_oic_POR.jsp-->
<title>BBVA - Transferências - Transferências OIC</title>
<LINK rel=STYLESHEET type='text/css' href="estilos/tablas.css">
<!--script language="javascript" src "js/dynlayer.js"></script-->
<script language="Javascript" src="js/banner.js"></script>
<script language="Javascript" src="js/tp_oic.js"></script>
<script language="Javascript" src="js/utilidades.js"></script>
<script language="javascript" src="js/limpar.js"></script>
<script language="javascript" src="js/tiempo.js"></script>
</HEAD>
<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" class="pag-contenido" onLoad="controlSesion();">
<%@ include file ="includecbtf.jsp" %>
<% String s = (String)datos.get("dt");
java.util.StringTokenizer str = new java.util.StringTokenizer(s, "-");
String anoServer = str.nextToken() ;
String mesServer = str.nextToken() ;
String diaServer = str.nextToken() ;
%>
<!--1�form-->
<form method="post" name="captura" action="<%=urls.get("action")%>">
<center> <!--1�center-->
<br>
<!--1�table-->
<table border="0" cellpadding="0" cellspacing="0" width="500"> <!--table das transf e nome-->
<tr>
<td colspan="3"><img src="images/linea.gif" border="0"></td>
</tr>
<tr>
<td width="250"><img src="images/traspasos.gif" border="0"></td>
<td width="82"><img src="images/titular.gif" border="0"></td>
<td width="169" class="fondotitular"><font class="texttitular"><%=datos.get("usuario")%></font></td>
</tr>
<tr>
<td colspan="3"><img src="images/linea.gif" border="0"></td>
</tr>
</table> <!--Fim do 1� table-->
<br><br>
</center> <!--Fim do 1� Center-->
<center> <!--2� Center-->
<!--Conteudo do table 2-->
<table cellpadding="3" cellspacing="1" border="0" align="center" width="500"> <!--table referente a mensagem-->
<tr>
<td class="cabeceratitulo" colspan="2"><p class="titulotabla">Nota : As Transferências para outras Instituições de Crédito decorrem de acordo com os horários da Compensação Interbancária, não se responsabilizando o BBVA pela sua realização fora das regras em uso.</p></td>
</tr>
<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
</table> <!--fim do table2-->
</center> <!--Fim do 2� Center-->
<center> <!-- Inicio 3� Center-->
<!--Conteudo da table Combo-->
<!--Table3-->
<table cellpadding="3" cellspacing="1" border="0" align="center" width="500">
<tr>
<td class="cabeceratitulo" colspan="2"><p class="titulotabla">Transferência Conta a Conta para outras Instituiçôes de Crédito</p></td>
</tr>
<tr>
<td class="formgrisosc" width="100">
<p class="dato">Conta Ordenante: </p></td>
<td class="formgrisosc" width="300">
<%
java.util.Vector v = (java.util.Vector)(datos.get("ListaCuentas"));
java.util.Hashtable elem;
java.util.Enumeration e = v.elements();
%>
<!--1� Select-->
<select name="conta" size="1" class="formgrisosc">
<%
while (e.hasMoreElements()){
elem = (com.ibm.dse.base.Hashtable)(e.nextElement());
String cuenta = ((String)elem.get("s_banco")).trim() + "-"+((String)elem.get("s_oficina")).trim()+((String)elem.get("s_dcontrol")).trim()+((String)elem.get("s_num_cuenta")).trim();
out.println("<option value=\"" + ((String)elem.get("s_tipo")) + "$" + ((String)elem.get("s_clave_asunto")) + "\">" + cuenta + "</option>");
%>
</select> <!--Fim do 1� Select-->
</td>
</tr>
<tr>
<td class="formgriscla" width="100"><p class="dato">Data de Processamento:</p></td>
<td class="formgriscla">
<input type="text" name="dia" size="2"class="formgriscla" value="<%=diaServer %>" maxlength="2" class="formgriscla"> /
<input type="text" name="mes" size="2"class="formgriscla" value="<%=mesServer %>" maxlength="2" class="formgriscla"> /
<input type="text" name="ano" size="4"class="formgriscla" value="<%=anoServer %>" maxlength="4" class="formgriscla"></td>
<input type="hidden" name="dact" size="2"class="formgriscla" value="<%=diaServer %>" maxlength="2" class="formgriscla">
<input type="hidden" name="mact" size="2"class="formgriscla" value="<%=mesServer %>" maxlength="2" class="formgriscla">
<input type="hidden" name="aact" size="4"class="formgriscla" value="<%=anoServer %>" maxlength="4" class="formgriscla"></td>
</tr>
<tr>
<td class="formgrisosc" width="100"><p class="dato">Moeda: </p></td>
<td class="formgrisosc"><p class="dato">
<!--Select 2�Ver este bem-->
<select name="Moeda" size="1" class="formgrisosc">
<option value="PTE" selected>Escudos</option>
<option value="EUR">Euros</option>
</select> </p>
</td>
</tr>
<tr>
<td class="formgriscla" width="100"><p class="dato">Importância:</p></td>
<td class="formgriscla"><input type="text" name="importancia" size="20" maxlength="15" class="formgriscla"></td>
</tr>
<tr>
<td class="formgrisosc" width="100"><p class="dato">Refêrencia:</p></td>
<td class="formgrisosc"><input type="text" name="ref" size="15" maxlength="10" class="formgrisosc"></td>
</tr>
<tr>
<td class="formgriscla" width="100"><p class="dato">NIB Beneficiário:</p></td>
<td class="formgriscla"><input type="text" name="nibBeneficiario" size="30" maxlength="21" class="formgriscla"></td>
</tr>
<tr>
<td class="formgrisosc" width="100"><p class="dato">Descrição p/ Conta Débito:</p></td>
<td class="formgrisosc"><input type="text" name="debito" size="45" maxlength="45" class="formgrisosc"></td>
</tr>
<tr>
<td class="formgriscla" width="100"><p class="dato">Descrição p/ Conta Crédito:</p></td>
<td class="formgriscla"><input type="text" name="credito" size="45" maxlength="45" class="formgriscla"></td>
</tr>
<tr>
<td class="cabecera" colspan="2"><img src="images/1x1.gif" width=1 height=3 border="0"></td>
</tr>
</table> <!--Fim do table 3-->
</center> <!--Fim do 3�center-->
<center> <!--Inicio do 4� Center-->
<!--Inicio da table 4�-->
<table border="0" cellspacing="2" cellpadding="0">
<tr>
<td valign="top"><img src="images/limpar.gif" border="0" alt="Apagar"></td>
<td valign="top"><img src="images/continuar.gif" border="0" alt="Continuar"></td>
</tr>
</table> <!--Fim do 4� Table-->
</form> <!--Fim do FORM-->
</center> <!--Fim do 4� Center-->
</body> <!--Fim do BODY-->
</html> <!--Fim do Html-->
Thanks pepole!thanks people! when i try to validate the action "PTE" he gaves me (if i put a ALERT...) null.
the js code is : (Moeda is coin )
//testa amount
// var ent = (f.amount.value);
var tamanho = f.amount.value.length;
var valor = f.amount.value;
decimals = 2; // Apenas pode ter duas casas decimais?
if (((tamanho == 0) || (valor == 0)) && ok)
alert ("A import�ncia tem de ser maior que zero.");
f.amount.focus();
f.amount.select();
ok = false;
else
alert(f.Moeda.value);
if((f.Moeda.value=="PTE") && ok)
for (j = 0; j < tamanho; j++)
xx = valor.charAt(j);
if ((!(xx.match(numeroER)) && ok))
alert ("O Campo Import�ncia deve ser num�rico inteiro.");
f.amount.focus();
f.amount.select();
ok = false;
//if para limitar valor dos Escudos
if (ok)
if (eval(valor) > 1000000)
alert ("The field amount must be maxium 1 000 000 Pte.");
f.amount.focus();
f.amount.select();
ok = false;
else
if (ok)
//function checkDecimals(f.amount, f.importancia.value) {
if (isNaN(valor)) {
alert("O Campo Import�ncia deve ser num�rico e como separador decimal, o ponto.");
f.amount.select();
f.amount.focus();
ok = false;
else {
timeshundred = parseFloat(valor * Math.pow(10, decimals));
integervalue = parseInt(parseFloat(valor) * Math.pow(10, decimals));
if (timeshundred != integervalue)
alert ("Apenas pode ter " + decimals + " casas decimais. Por favor tente outra vez.");
f.amount.select();
f.amount.focus();
ok = false;
if (ok)
{ //if to limit the value of the Euros
if(eval(valor) > 4988)
alert ("The field amount must be maxium 4988 Eur.");
f.amount.focus();
f.amount.select();
ok = false;
}//end of amount -
In sql statements with JSP. Heres the deal:
Access database:
Tablename: EVENT
FieldName: event_id
DataType: Number
I want to compare the event_id to an integer variable called "var" in a WHERE clause in an SQL statement through a JSP.
String query = "SELECT * FROM EVENT WHERE EVENT.event_id = 'var' ";
It says "Data type mismatch in criteria expression."
Any Suggestions? I thought this should be straight forward! am i missing something?if i am reading correctly "var" is an int variable correct? If this is the case then the following will work;
String query = "SELECT * FROM EVENT WHERE EVENT.event_id = " + Interger.toString(var) ;
Hope that helps ( and i hope i read your problem correctly) -
Hi,
I am developing enterprise application using jboss portlets, ejb, jsp, jstl, other stuff on jboss AS.
I am facing some interesting problem in a jsp page which uses jstl. I have configured all jsp configurations with my web application.
Presently i am putting an endpage, current page integer values in a session.
In JSP page whenever i want to iterate a loop and some checks on endPage, curPage it gives me NumberFormatException and finally it results to compile the jsp page.
The error comes when i am using these variables from session with JSTL tags. The snippet where the problem seems to be is as :
<c:forEach var="selection" begin="1" end="${endPage}">
<c:if test="${selection == curPage}">
May anyone help me on this or whether the there may be some problems with the JSTL configurations ?
In my view JSTL configurations is ok but the problems seems to be in the statements above or there may be some other way to define it.
Any inputs ?
-Sachin
Software Engineer,
EpiComm Technologies.The Snippet of Error Stack Trace on server console is here:
11:38:32,234 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NumberFormatException: For input string: "${endPage}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:468)
at java.lang.Integer.valueOf(Integer.java:574)
at org.apache.jasper.compiler.JspUtil.coerceToInt(JspUtil.java:752)
at org.apache.jasper.compiler.Generator$GenerateVisitor.convertString(Generator.java:2914)
at org.apache.jasper.compiler.Generator$GenerateVisitor.evaluateAttribute(Generator.java:2717)
at org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:2823)
at org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:2156)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1665)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1685)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Generator.generate(Generator.java:3270)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.portal.portlet.impl.PortletRequestDispatcherImpl.execute(PortletRequestDispatcherImpl.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) -
Problems with JSP-ApplicationModule pooling in runtime
Hello!
I have an urgent Problem with the ApplicationModule Pooling in Runtime. The Application uses JSP with BC4J and is deployed on Tomcat 3.1 and MS IIS 4.0 (The Client want to use this MS-Product). We use JDev 3.1.1.2 for development.
Now my Problem:
A user start the IE4 and log on to the application and it works fine. They log off and log in again a second time and then the user gets a NullPointerException at the point when the Application wants to checkout a new instance from the ApplicationModule Pool. The next time he logs on it works fine again and the next time not and so on. Every second time the user logs on he gets a NullPointerException.
But there are three AdminUsers and with these users are no Problems.
Can anyone help me or has someone the same problems?
Greetings
ThorstenThere are a number of pooling problems fixed in JDeveloper 3.2. You can also step into the pooling code by using remote debugging to figure out why you are encountering this problem.
-
Initial problem with JSP Custom Tag devolopment
Hi ,
I have encountered a problem with my JSP application which utilizes a simple custom tag.
First I created followinng directories.
1. %TOMCAT_HOME%\webapps\testTags
2. %TOMCAT_HOME%\webapps\testTags\META-INF
3. %TOMCAT_HOME%\webapps\testTags\WEB-INF
4. %TOMCAT_HOME%\webapps\testTags\WEB-INF\tlds
5. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes
6. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com
7. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271
8. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271\testTags
I created the essential four files, that is named as follows.
1.TagError.java
2.web.xml
3.testTld.tld
4.testJsp.jsp
Then i put the files under these directories as given below
testJsp.jsp under %TOMCAT_HOME%\webapps\testTags.
web.xml under %TOMCAT_HOME%\webapps\testTags\WEB-INF
TagError.java under %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes
TagError.class under %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271\testTags
testTld.tld %TOMCAT_HOME%\webapps\testTags\WEB-INF\tlds
Here is the content inside the files.
1.TagError.java
package com.tek271.testTags;
import java.io.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class TagError extends TagSupport {
private String mColor = "red";
public void setColor(String aColor) {
mColor = aColor;
} // setColor
public int doStartTag() throws JspException {
try {
JspWriter out = pageContext.getOut();
out.print("<font color=\"");
out.print(mColor);
out.print("\"><b>Error: ");
} catch (IOException ex) {
throw new JspTagException(ex.getMessage());
return EVAL_BODY_INCLUDE; // other return: SKIP_BODY
} // doStartTag()
public int doEndTag() throws JspException {
try {
JspWriter out = pageContext.getOut();
out.println("</b></font><br>");
} catch (IOException ex) {
throw new JspTagException(ex.getMessage());
return EVAL_PAGE; // other return: SKIP_PAGE
} // doEndTag()
} // TagError
2.web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>
<taglib>
<taglib-uri>/testTaglib</taglib-uri>
<taglib-location>/WEB-INF/tlds/testTld.tld</taglib-location>
</taglib>
</web-app>
3.testTld.tld
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>testTld</shortname>
<info>Testing jsp tags</info>
<tag>
<name>tagError</name>
<tagclass>com.tek271.testTags.TagError</tagclass>
<bodycontent>JSP</bodycontent> <!-- Also: empty, tagdependent -->
<info>Show a string as an error message</info>
<attribute>
<name>color</name>
<required>false</required>
</attribute>
</tag>
</taglib>
4.testJsp.jsp
<%@ taglib uri="/testTaglib" prefix="test" %>
<html>
<head>
<title>Testing Tag Library</title>
</head>
<body>
<test:tagError>Invalid user name</test:tagError>
<test:tagError color="blue">Invalid Password</test:tagError>
</body>
</html>
but i am getting the following error.
Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
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: File "/testTaglib" not found
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:214)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1162)
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:758)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:121)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
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: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.valves.CertificatesValve.invoke(CertificatesValve.java:246)
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.StandardContext.invoke(StandardContext.java:2343)
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:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)
why is it like this ?please give me a solution.
Thanking in advance.
From
Vinod A.Dear patreck ,
It does not work.
I have replaced the line
<%@ taglib uri="/testTaglib" prefix="test" %>
with
<%@ taglib uri="WEB-INF/tlds/testTaglib" prefix="test" %>
but now it shows the error ,
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: File "/testTags/WEB-INF/tlds/testTaglib" not found
any more suggestion ?
From Vinod A. -
Problems with License extension
Hello,
i have a problem with extending of the minisap license. I follow the steps on the site www.sap.com/solutions/netweaver/minisap.asp and executed the saplicense.exe -get, but the window was opened and directly closed. So I didn't get any hardwarekey.
Further the site described, I should follow the introduction on "Installing the SAP License" on CD1 in the mini_doc.html document, but on the CD1 there wasn't no such document.
What can I do now? I need the extension very urgent.
Thanks
Regards
NicoleHi Nicole,
Just login to sap and execute Transaction SLICENSE.
you can find your hardware key frim here also.
Regards
Subhash -
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="picture" class="entities.Picture" scope="session"></jsp:useBean>
<%!
public List<Picture> getAllPictures() {
Session session = Connector.getHbSession();
Query query = session.createQuery("from Picture");
List<Picture> pictures = query.list();
if (pictures != null) {
return pictures;
} else {
return null;
%>
${picture.pictureName }
<%@page import="dataAccessLayer.DataGetter"%>
<%@page import="java.util.List"%>
<%@page import="entities.Picture" %>
<%@page import="connection.Connector" %>
<%@page import="org.hibernate.Session"%>
<%@page import="org.hibernate.Query"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
</body>
</html>
I've written this jsp and I'm getting problems with the hibernate part. It says that org.hibernate.Session and org.hibernate.Query cannot be resolve although I have imported them.
I know there are probably a lot of wrong things in it so please can anyone tell me how to fix it. Thank you in advance.Your hibernate classes need to be available to the web application classpath.
That normally means the WEB-INF/lib directory.
This sort of code is best done in a bean in any case, rather than a JSP. -
I am having some serious problems with getting a JSP to access a JavaBean that I have created. I am using Tomcat and Java 1.4 by the way.
I have set my classpath and all other code continues to work apart from the accessing of the JavaBean. I have created a JavaBean which is as follows:
public class UserData {
String username;
String email;
int 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; }
The class compiles no problem and I have placed it in the WEB-INF/Classes directory. However when I use the JSP to call it:
<jsp:useBean id="user" class="UserData" scope="session"/>
<jsp:setProperty name="user" property="*"/>
<HTML>
<BODY>
Continue
</BODY>
</HTML>
I get the following error:
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred at line: 1 in the jsp file: /saveName.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\saveName$jsp.java:56: Class org.apache.jsp.UserData not found.
UserData user = null;
^
An error occurred at line: 1 in the jsp file: /saveName.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\saveName$jsp.java:59: Class org.apache.jsp.UserData not found.
user= (UserData)
^
An error occurred at line: 1 in the jsp file: /saveName.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\saveName$jsp.java:64: Class org.apache.jsp.UserData not found.
user = (UserData) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "UserData");
^
3 errors, 1 warning
I cannot work out as to why it is doing this. Any help at all would be really appreciated.
Regards
IanHi...
Can you try making these changes...
public class UserData {
String username="";
String email="";
int age=0;
public void setUsername( String value )
this.username = value;
public void setEmail( String value )
this.email = value;
public void setAge( int value )
this.age = value;
Regds
Vasi -
Problems with JSP and MySql bean.
Hi,
I'm new to JSP and I'm having some problems with it. I'm trying to do a simple login where a java class (bean?) handles the SQL injektion. I have deployed the page on tomcat and it works fine, except that the sqlinjektion does basically nothing. I have installed the mysql driver. I think there is something wrong with the java class, or the way im calling it. It does not produce any error. But its like it would never actually process the java code, because ive tried to append things to error string to see what is going on, nothing happens. everything stay null, no exceptions are thrown. If I implement the code to JSP itself, it does load the driver and print exception that there is no connection to database (which is correct). What am I missing? Code follows:
the sqlhandler:
public abstract class SqlInjektor {
private static String Database = "*****";
private static String serverName = "localhost:3306";
private static String usrName="******";
private static String passw="******";
* @return Connection
public static Connection createConnection(String error){
Connection mySqlCon = null;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch(Exception E){
PrintWriter out = response.getWriter();
out.println("lol");
String url = "jdbc:mysql://" + serverName + "/" + Database + "?user=" + usrName + "&password=" + passw;
try{
mySqlCon = DriverManager.getConnection(url);
catch (Exception E){
E.printStackTrace(System.out);
return mySqlCon;
* Metodi saa sy�tteen��n SQL komennon, jonka se suorittaa sek� palauttaa komennon tulokset.
* @param command
* @return ResultSet
public static ResultSet querySQL(String command,String error, Connection con){
ResultSet rs = null;
try{
Statement stmt = con.createStatement();
rs = stmt.executeQuery(command);
catch(Exception E){
E.printStackTrace(System.out);
return rs;
the jsp page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page isErrorPage="false" %>
<%@ page import="java.sql.*" %>
<%@page import="ot3.User"%>
<%@page import="ot3.SqlInjektor"%>
<%@page import="Javax.servlet.jsp.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>vastaanotto</title>
</head>
<body>
<%! String id;
String password;
String error = new String("Error!\n");
User user;
%>
<% user = new User();
session.putValue("currentUser",user);
id = request.getParameter("authName");
password = request.getParameter("Password");
Connection conn=null;
ResultSet rs=null;
conn = SqlInjektor.createConnection(error);
if(conn!=null){
out.println("conn ok!");
rs = SqlInjektor.querySQL("SELECT * FROM user WHERE id='" + id +"' AND password='" + password+"' COLLATE latin1_bin;",error,conn);}
try {
if (rs!= null && rs.next()){
user.setID(rs.getInt("id"));
user.setName(rs.getString("name"));
user.setPassword(rs.getString("password"));
user.setClearance(rs.getInt("clearance"));
if(rs.getString("addedby")!=null)
user.setAdder(rs.getInt("addedby"));
if(rs.getString("lastmodifier")!=null)
user.setModifier(rs.getInt("lastmodifier"));
rs.close();%>
ONNISTU!
<%}
else {
out.println(error);
} catch (SQLException e) {
out.println(e.getMessage());
}%>
</body>
</html>Hi,
I'm new to JSP and I'm having some problems with it. I'm trying to do a simple login where a java class (bean?) handles the SQL injektion. I have deployed the page on tomcat and it works fine, except that the sqlinjektion does basically nothing. I have installed the mysql driver. I think there is something wrong with the java class, or the way im calling it. It does not produce any error. But its like it would never actually process the java code, because ive tried to append things to error string to see what is going on, nothing happens. everything stay null, no exceptions are thrown. If I implement the code to JSP itself, it does load the driver and print exception that there is no connection to database (which is correct). What am I missing? Code follows:
the sqlhandler:
public abstract class SqlInjektor {
private static String Database = "*****";
private static String serverName = "localhost:3306";
private static String usrName="******";
private static String passw="******";
* @return Connection
public static Connection createConnection(String error){
Connection mySqlCon = null;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch(Exception E){
PrintWriter out = response.getWriter();
out.println("lol");
String url = "jdbc:mysql://" + serverName + "/" + Database + "?user=" + usrName + "&password=" + passw;
try{
mySqlCon = DriverManager.getConnection(url);
catch (Exception E){
E.printStackTrace(System.out);
return mySqlCon;
* Metodi saa sy�tteen��n SQL komennon, jonka se suorittaa sek� palauttaa komennon tulokset.
* @param command
* @return ResultSet
public static ResultSet querySQL(String command,String error, Connection con){
ResultSet rs = null;
try{
Statement stmt = con.createStatement();
rs = stmt.executeQuery(command);
catch(Exception E){
E.printStackTrace(System.out);
return rs;
the jsp page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page isErrorPage="false" %>
<%@ page import="java.sql.*" %>
<%@page import="ot3.User"%>
<%@page import="ot3.SqlInjektor"%>
<%@page import="Javax.servlet.jsp.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>vastaanotto</title>
</head>
<body>
<%! String id;
String password;
String error = new String("Error!\n");
User user;
%>
<% user = new User();
session.putValue("currentUser",user);
id = request.getParameter("authName");
password = request.getParameter("Password");
Connection conn=null;
ResultSet rs=null;
conn = SqlInjektor.createConnection(error);
if(conn!=null){
out.println("conn ok!");
rs = SqlInjektor.querySQL("SELECT * FROM user WHERE id='" + id +"' AND password='" + password+"' COLLATE latin1_bin;",error,conn);}
try {
if (rs!= null && rs.next()){
user.setID(rs.getInt("id"));
user.setName(rs.getString("name"));
user.setPassword(rs.getString("password"));
user.setClearance(rs.getInt("clearance"));
if(rs.getString("addedby")!=null)
user.setAdder(rs.getInt("addedby"));
if(rs.getString("lastmodifier")!=null)
user.setModifier(rs.getInt("lastmodifier"));
rs.close();%>
ONNISTU!
<%}
else {
out.println(error);
} catch (SQLException e) {
out.println(e.getMessage());
}%>
</body>
</html> -
Bizarre thread problem with JSP
I'm having a strange problem using JSPs whereby a single method call to a
bean results in 2 execute threads being created each executing the method
called.
I have a bean reference in the jsp that has session scope declared like this
(package names left off):
<jsp:useBean id="deployment" class="Deployment" scope="session">
<% deployment.init(application); %>
</jsp:useBean>
I've also set the isThreadSafe value to "false" (since I'm trying to
prevent/figure out what's going on):
<%@ page isThreadSafe="false" %>
Within the JSP body I have code that makes the method call on the deployment
bean:
if (action.equals("Send"))
int status = deployment.send();
Then, within my form I have:
<INPUT TYPE="image" SRC="../images/Deploy.gif"
onClick="confirmAndSubmit('Send',
'Deploying Application to server <%=
deployment.getServer() %>')"/>
Where the functions called are:
function setActionSubmit(action) {
document.deployForm.actionPerformed.value = action;
document.deployForm.submit();
function confirmAndSubmit(action, promptString) {
if (confirm(promptString)) {
setActionSubmit(action);
Tracing, thread dumping, et al, have confirmed that although I have a single
session, I end up with two threads each executing the deployment.send()
method.
Any ideas? I'm stumped.
Thanks,
Jim
I found the problem, although I don't completely understand the behavior:
The FORM was not handling the submit event, leaving it to the whim of the
browser to have its way with the event. Although it sometime ended up
having two threads serving the request, it didn't always.
The solution was to put an onSubmit=="return false;" in the <form>
Hope this helps someone else.
Jim
"Jim Gish" <[email protected]> wrote in message
news:[email protected]...
> I'm having a strange problem using JSPs whereby a single method call to a
> bean results in 2 execute threads being created each executing the method
> called.
>
> I have a bean reference in the jsp that has session scope declared like
this
> (package names left off):
>
> <jsp:useBean id="deployment" class="Deployment" scope="session">
> <% deployment.init(application); %>
> </jsp:useBean>
>
> I've also set the isThreadSafe value to "false" (since I'm trying to
> prevent/figure out what's going on):
> <%@ page isThreadSafe="false" %>
>
> Within the JSP body I have code that makes the method call on the
deployment
> bean:
> if (action.equals("Send"))
> {
> int status = deployment.send();
> }
>
> Then, within my form I have:
> <INPUT TYPE="image" SRC="../images/Deploy.gif"
> onClick="confirmAndSubmit('Send',
> 'Deploying Application to server <%=
> deployment.getServer() %>')"/>
>
> Where the functions called are:
> function setActionSubmit(action) {
> document.deployForm.actionPerformed.value = action;
> document.deployForm.submit();
> }
>
> function confirmAndSubmit(action, promptString) {
> if (confirm(promptString)) {
> setActionSubmit(action);
> }
> }
>
> Tracing, thread dumping, et al, have confirmed that although I have a
single
> session, I end up with two threads each executing the deployment.send()
> method.
>
> Any ideas? I'm stumped.
>
> Thanks,
> Jim
>
>
>
>
>
-
Apache/Jserv Config Problem with JSP
Problem: Any JSP that contains a bean reference is not being loaded correctly.
The first thing I did was to create a softlink from the ".../Apache/Apache/htdocs" directory to
the directory which contains my *.html and *.jsp files (as instructed in the httpd.conf file).
Then, I followed the instructions on page A-9 of "OracleJSP Developer's Guide and
Reference, Release 1.1.0.0.0". They instruct you to add a wrapper.classpath entry into
jserv.properties that points at your directory that contains the .class files for your bean
classes. I did this too.
I then attempted to load my JSP file from the browser URL entry line. If my JSP does not contain
a reference to a bean, then the page loads fine. If it contains a reference to a bean, then I
get the following message:
Request URI:/webdocs/vps/hellouser/hellouser.jsp
Exception:
oracle.jsp.parse.JspParseException: Line # 4, Error: Unable to find class for bean: myBean defined
by tag with class: hello.NameHandler
I cannot for the life of me get Apache to look in one directory for the .jsp file and another for
the .class file(s). Any suggestions would be greatly appreciated!
MORE BACKGROUND:
If it matters..... My first venture was servlets and I've managed to workt that just fine: I
successfully modified "jserv.conf" to add a mount point (ApJServMount) for my new servlet zone
which I have specified in "jserv.properties". I have also created an associated properties file
for my new servlet zone. I've tested this configuration and all works fine for servlets, just not
JSP.
Once again, thanks in advance for any help regarding a solution to this problem!!!
DaveProblem: Any JSP that contains a bean reference is not being loaded correctly.
The first thing I did was to create a softlink from the ".../Apache/Apache/htdocs" directory to
the directory which contains my *.html and *.jsp files (as instructed in the httpd.conf file).
Then, I followed the instructions on page A-9 of "OracleJSP Developer's Guide and
Reference, Release 1.1.0.0.0". They instruct you to add a wrapper.classpath entry into
jserv.properties that points at your directory that contains the .class files for your bean
classes. I did this too.
I then attempted to load my JSP file from the browser URL entry line. If my JSP does not contain
a reference to a bean, then the page loads fine. If it contains a reference to a bean, then I
get the following message:
Request URI:/webdocs/vps/hellouser/hellouser.jsp
Exception:
oracle.jsp.parse.JspParseException: Line # 4, Error: Unable to find class for bean: myBean defined
by tag with class: hello.NameHandler
I cannot for the life of me get Apache to look in one directory for the .jsp file and another for
the .class file(s). Any suggestions would be greatly appreciated!
MORE BACKGROUND:
If it matters..... My first venture was servlets and I've managed to workt that just fine: I
successfully modified "jserv.conf" to add a mount point (ApJServMount) for my new servlet zone
which I have specified in "jserv.properties". I have also created an associated properties file
for my new servlet zone. I've tested this configuration and all works fine for servlets, just not
JSP.
Once again, thanks in advance for any help regarding a solution to this problem!!!
Dave
Maybe you are looking for
-
Satellite A200 screen stays black when trying to boot
Hello everyone, My Toshiba Satellite A200 notebook is not working anymore, so everything started when I was playing a game, suddenly, the screen turned blue with some tiny text written on it. I had to hold the power button a few seconds to close it b
-
How do I find out the number of rows in a resultset ?
Without scrolling it.
-
Hello - My iMac has developed a video display problem. Everything now appears in a strange, cartoonish way. Purples, greens, blues. Can this be fixed, and if so, any idea how much it might cost? Also, could I output to a seperate monitor? I plan to r
-
Where is the show duplicates feature in iTunes 11?
Is the display duplicates feature gone completely in iTunes 11? If not is there anyone who can tell me how to find it?
-
any one having issues with songs playing in there entirety using itunes match? plays parts of songs and skips and starts playing second song. part and then keeps playing with no music. does this on every set of songs.