Hi All,
I'm also new to Struts.So was experimenting with the stuffs. I also coem across the same problem. I'm attaching the html code and my Actionbean. CAn anybody help?
HTML
===============================
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h2>Hello World!</h2>
<html:form action="/login"/>
<html:submit value="Login"/>
<table border="1">
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Enter your name: </td>
<td><html:text property="name"/></td>
</tr>
<tr>
<td>Enter your email:</td>
<td><html:text property="email"/></td>
</tr>
<tr>
<td></td>
<td><html:submit value="Login"/></td>
</tr>
</tbody>
</table>
</body>
</html>
================================
Bean
================================
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
*Please* put your code in code tags so it's easier to read. It's also beneficial to remove any non-essential code/comments/HTML/etc. to reduce cognitive noise.
Without the configuration for this action it's difficult to help. Are you accessing the page directly (via a URL ending with JSP) or through an action?
Also, unless you have a reason for starting with Struts 1, you might be better off learning Struts 2.