Hello,
 
I am using struts 1.2.4 and Tomcat 5.0.28. I am trying to get simple
login page working but as soon as I use one of html:text or
html:password I ran into compilation error. Below are the error and the
page that's causing it. When I remove the html:text and use <input
type="text" name="username" value="${loginForm.map['username']}"> it
works fine. Any ideas on what's cusing this and how to correct it?
 
Thanks
 
ERROR:  
org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
C:\Tomcat
5.0\work\Catalina\localhost\sprintMOR\org\apache\jsp\login_jsp.java:123:
_jspx_meth_html_text_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp
.PageContext) in org.apache.jsp.login_jsp cannot be applied to
(org.apache.struts.taglib.html.FormTag,javax.servlet.jsp.PageContext)
        if (_jspx_meth_html_text_0(_jspx_th_html_form_0,
_jspx_page_context))
            ^
1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHa
ndler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.ja
va:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja
va:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va: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)
 
PAGE:
 
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ taglib uri="/WEB-INF/tags/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tags/struts-html.tld" prefix="html" %>
 
<html>
<head>
  <title>LOGIN</title>
</head>
 
<body>
 
<html:form action="/login">
  <center>
  <p>
  <strong>You are trying to enter protected part of contact system.<br>
  Please enter your username and password.
  </strong>
  </p>    
  <p>
  Username:
  <html:text property="username" /> 
  </p>
  <p>
  Password:
  <input type="text" name="password"
value="${loginForm.map['password']}" />
  </p>
  <input type="submit" name="login" value="Login"/> 
 </center>
</html:form>
 
<center>
<ul class="error">
 <html:errors/>
</ul>
</center>
</body>
</html>

Reply via email to