my dog learned polymorphism
The moose likes JSP and the fly likes Why I get a blank page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Why I get a blank page?" Watch "Why I get a blank page?" New topic

Why I get a blank page?

Yashnoo lyo
Ranch Hand

Joined: Feb 17, 2003
Posts: 152
I make a simple logon struts application.The index page is logon.jsp and it will go to secret.jsp if
the name and password is correct.But it will go to a blank page when user click the submit button unless
the "name" and "password" is correct.My struts-config.xml has any problem?I think mybe my LogonAction
is not correct but I don't know where.My directory is:"C:\tomcat\webapps\ROOT\struct".
<html:form action="/logon" focus="name">
<td><html:text property="name"/></td>
<td><html assword property="password"/></td>
public class LogonAction extends Action{
public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest req,HttpServletResponse resp)
throws IOException,ServletException{
String name=req.getParameter("name");
String pass=req.getParameter("password");
PrintWriter out=resp.getWriter();
out.println("Debug... ...");
HttpSession session=req.getSession();
return new ActionForward("/mainpage.jsp");
return new ActionForward("/mainpage.jsp");
<form-bean name="logonForm" type="struts.lyo.Logonform"/>
<forward name="logout" path="/" />
<forward name="secret" path="/secret.jsp" />
<action path="/logon" name="logonForm" type="struts.lyo.LogonAction"/>
<action path="/logout" type="struts.lyo.LogoffAction"/>
public class Logonform extends ActionForm{
private String name;
private String password;
public void setName(String name){;
public String getName(){
public void setPassword(String password){
public String getPassword(){
return this.password;
Any error?help ... :roll:

When I face C# and Java I choose Java.
Yashnoo lyo
Ranch Hand

Joined: Feb 17, 2003
Posts: 152
The problem solved!I change the "execute" method to "perform" method in my "LogonAction".It worked
as I expected.But I can't really know Why.I use struts1.0.Does struts1.1 has the "perform" method only?
I think "struts1.0" use the "execute" method in Action. Anyone can give me some idea?
Consider Paul's rocket mass heater.
subject: Why I get a blank page?
It's not a secret anymore!