File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Errors regarding Login.jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Errors regarding Login.jsp" Watch "Errors regarding Login.jsp" New topic
Author

Errors regarding Login.jsp

Anu Gupta
Greenhorn

Joined: May 26, 2006
Posts: 3
Hello Guys,

I am facing this strange problem in my Login.jsp page. Whenevr I type

<html:text property="username" size="16" "/>. The jsp is giving an error.

However if I type something else inplace of the above, there is no error.

I am posting the code for Login.jsp and the error.

Please help me I am stuck in this code since last 1 week.

Regards,

anurag

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>


<html>

<head>

<title><bean:message key="title.login"/></title>
<html:base/>

</head>

<body>

<html:form action="/login"

name="LoginForm"
type="org.apache.struts.validator.DynaValidatorForm"
onsubmit="return validateLoginForm(this);">

<table border="0" width="100%">

<tr>
<th align="right">
<bean:message key="label.username"/>

</th>

<td align="left">

</td>

</tr>

<tr>
<th align="right">
<bean:message key="label.password"/>
</th>

<html:text property="username" size="16"/>


<td align="left">
<html assword property="password" size="16" redisplay="false"/>
</td>
</tr>

<tr>
<td align="right">
<html:submit value="Login"/>
</td>
<td align="left">
<html:reset/>
</td>
</tr>

</table>

</html:form>


</body>

</html>



org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:346)
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:810)


??

java.lang.NullPointerException
org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1109)
org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:952)
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
org.apache.jsp.Login_jsp._jspx_meth_html_text_0(Login_jsp.java:269)
org.apache.jsp.Login_jsp._jspx_meth_html_form_0(Login_jsp.java:189)
org.apache.jsp.Login_jsp._jspService(Login_jsp.java:97)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
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:810)
Sachin Kediyal
Greenhorn

Joined: May 11, 2006
Posts: 9
Hi Anurag,
Can you also provide the source code for your ActionForm class and the struts-config.xml file.
Anu Gupta
Greenhorn

Joined: May 26, 2006
Posts: 3
Hi Sachin,

I have used the DynaAction Form so the action form entries are written in the struts-config.xml file. I have attaching it before. Thanks for going through it.

Regards,

anurag

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"

"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>


<!-- ========== Form Bean Definitions =================================== -->
<form-beans>
<!-- Login form bean -->

<form-bean name="LoginForm" type="org.apache.struts.validator.DynaValidatorForm">

<form-property name="username" type="java.lang.String"/>
<form-property name="password" type="java.lang.String"/>
</form-bean>

<!-- Main form bean -->
<form-bean name="MainForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="username" type="java.lang.String"/>
</form-bean>

<!-- Info form bean -->
<form-bean name="InfoForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="drink" type="java.lang.String"/>
<form-property name="designation" type="java.lang.String"/>
<form-property name="comment" type="java.lang.String"/>
<form-property name="fullname" type="java.lang.String"/>
<form-property name="food" type="java.lang.String"/>
<form-property name="username" type="java.lang.String"/>
<form-property name="password" type="java.lang.String"/>
<form-property name="hobby" type="java.lang.String"/>
<form-property name="id" type="java.lang.String"/>
<form-property name="sex" type="java.lang.String"/>
</form-bean>

</form-beans>
<global-exceptions/>

<!-- ========== Global Forward Definitions ============================== -->
<global-forwards>
<forward name="login" path="/Login.jsp"/>
</global-forwards>

<!-- ========== Action Mapping Definitions ============================== -->
<action-mappings>

<!-- Process a user login -->

<action input="/Login.jsp" name="LoginForm" path="/login"
scope="session" type="struts.webapp.LoginAction">
<forward name="success" path="/Main.jsp"/>
<forward name="failed" path="/Login.jsp"/>
</action>
<!-- Process a Modify operation -->
<action input="/ModAdd.jsp" name="InfoForm" path="/modify"
scope="request" type="struts.webapp.ModifyAction">
<forward name="success" path="/Main.jsp"/>

</action>
<!-- Process a Add operation -->
<action name="InfoForm" path="/add" scope="request" type="struts.webapp.AddAction">
<forward name="success" path="/Main.jsp"/>

</action>
<!-- Process a Detail operation -->
<action name="InfoForm" path="/detail" scope="request" type="struts.webapp.DetailAction">
<forward name="back" path="/Main.jsp"/>
</action>

<!-- Process a user Logoff -->
<action name="MainForm" input="/Main.jsp" parameter="operation" path="/dispatch" type="struts.webapp.DispatchAction">
<forward name="logoff" path="/Login.jsp"/>
<forward name="add" path="/ModAdd.jsp"/>
<forward name="modify" path="/ModAdd.jsp"/>
<forward name="delete" path="/Main.jsp"/>
<forward name="detail" path="/Detail.jsp"/>
</action>
</action-mappings>

<controller contentType="text/html;charset=UTF-8"/>

<!-- ========== Message Resources Definitions =========================== -->

<message-resources parameter="struts.webapp.ApplicationResources"/>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">

<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>

</struts-config>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Errors regarding Login.jsp