This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
As Michal correctly points out, the LookupForm isn't in the session when the JSP tag tries to reference it. Here's why.
If you take a look at the "/Lookup" action mapping in your struts-config.xml, you'll see that it includes the following attribute setting: name="LookupForm". This tells Struts to try to find an instance of LookupForm in the configured scope (the default scope being 'session'). If no instance is found, the framework will create one and put it in scope under the key "LookupForm" automatically for you.
If you navigate directly to your example index.jsp after starting up the server, Struts won't have an opportunity to evaluate the action mapping, so the LookupForm won't be created.
To fix this, rename index.jsp (for example, you might want to name it something like 'Lookup.jsp'), and then create a new version of index.jsp that contains a 'Lookup' hyperlink, as in the following example:
When clicked, the hyperlink will trigger the action mapping so that the LookupForm instance will be created and placed in the session before the JSP tries to evaluate the <html:form> tag that refers to the instance.
There's one more thing you'll need to do to make this work. In struts-config.xml, change the 'forward' configuration in the "/Lookup" action mapping to make it forward to the new JSP, as in the following:
Joined: May 02, 2002
Thanks for the response. Now it gives me this error.
org.apache.jasper.JasperException: /index.jsp(25,0) Unable to find setter method for attribute: name