EL and parameters
I am having some issues with expression language and the submit button. There is a page that displays the value of a parameter(passed to page) called name. The user is given a text field to enter a new name and a button to submit the name back to page for another greeting. I guess my code is fine, I can see the initial form, when I hit the submit button nothing happens in code (a) and in another project code for which is in (b) it says requested resource not avaliable.
code (a)
templateText.jsp
<html>
<head>
<title>Professional JSP 2, 4th Edition</title>
<style>
body, td{font-family:verdana;;}
</style>
</head>
<body>
<h2>EL and Template Text</h2>
<table border="1">
<tr>
<td colspan="4">Hello ${param['name']}</td>
</tr>
<tr>
<form action="templateText.jsp" method="post">
<td><input type="text" name="name"></td>
<td><input type="submit"></td>
</form>
</tr>
</table>
</body>
</html>
The deployment desc for this is:
web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
</web-app>
(b) In another project the code is
simpleBean.jsp
<jsp:useBean id="person" class="com.apress.projsp.Person" scope="request">
<jsp:setProperty name="person" property="*"/>
</jsp:useBean>
<html>
<head>
<title>Professional JSP 2, 4th Edition</title>
<link rel="stylesheet" href="projsp.css">
</head>
<body>
<h2>EL and Simple JavaBeans</h2>
<table border="1">
<tr>
<td>${person["name"]}</td>
<td>${person.age}</td>
<td> </td>
</tr>
<tr>
<form action="simplebean.jsp" method="post">
<td><input type="text" name="name"></td>
<td><input type="text" name="age"></td>
<td><input type="submit"></td>
</form>
<tr>
</table>
</body>
</html>
JaavaBean is:
Person.java
package com.apress.projsp;
public class Person {
private String name;
private int age;
public Person() {
setName("A N Other");
setAge(21);
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setAge(int age) {
this.age = age;
}
public int getAge() {
return age;
}
}
Any help is greatly appreciated. Has it something to do with intranet settings? How do I fix this problem? Thanks

