/jsp/RegisterView.jsp(3,5) Invalid standard action

Status
Nicht offen für weitere Antworten.
A

andreas71

Gast
Hallo

ich versuche eine Login Seite mit Tomcat, JSP, Servlet und JavaBeans zu bauen, nur leider bekomme ich beim Starten die Fehlermeldung

Code:
org.apache.jasper.JasperException: /jsp/RegisterView.jsp(3,5) Invalid standard action

Ich glaube das das Servlet nicht gefunden wird. Hat von Euch jemand eine Idee?

RegisterView.jsp
Code:
<h2>Please register:</h2>

<jsp:usebean id="customer" class="de.dvorak.CustomerBean" scope="session"/>

<form action="/Laufveranstaltung2/de/dvorak/FrontControllerServlet" method=GET>
	<input type="hidden"  name="action" value="de.dvorak.RegisterAction"/>
	<table border="0">
	<tr><td>Title:</td><td>
	<input type="text" name="title" value="<jsp:getProperty name="customer" property="title"/>"/>
	</td></tr>
	<tr><td>Name:</td><td>
			<input type="text" name="name"  value="<jsp:getProperty name="customer" property="name"/>"/>
	</td></tr>
	<tr><td></td>
	<td><input type="submit" value="register now"/>	</td></tr>
	</table>
</form>

Dateistruktur für Eclipse Tomcat Projekt
..\Laufveranstaltung2\WEB-INF\src\de\dvorak für die Servlets
..\Laufveranstaltung2\jsp für die JSPs



Code:
package de.dvorak;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class for Servlet: FrontControllerServlet
 *
 */
 public class FrontControllerServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
	private static final long serialVersionUID = 1L;

	/* (non-Java-doc)
	 * @see javax.servlet.http.HttpServlet#HttpServlet()
	 */
	public FrontControllerServlet() {
		super();
	}

	/* (non-Java-doc)
	 * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String actionName = request.getParameter("action");
		if (actionName == null) {
			throw new ServletException("Parameter action can not be null");
		}
		try {
			// Action ist Interface damit die KLasse FrontControllerServlet unabhaengig von
			// den verschiedenen Action-Klasse ist. Diese Action-Klassen implementieren das
			// Interface Action
			Action action = (Action) Class.forName(actionName).newInstance();
			String forwardURL = action.execute(request, response);
			getServletContext().getRequestDispatcher(forwardURL).forward(request, response);
		} catch (Exception e){
			throw new ServletException(e);
		}
	}

	/* (non-Java-doc)
	 * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}
}

Danke und Gruß
Andreas
 
G

Guest

Gast
da scheint beim konstruktor etwas schief zu gehen. afaik muss die bean einen parameterlosen standardkonstruktor haben...hat sie das?
 
A

andreas71

Gast
die Bean sieht so aus

Code:
package de.dvorak;

public class CustomerBean {
	private static final long serialVersionUID = 1L;

	private String name ="";
	private String title = "";

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public boolean validate() {
		return name != null && ! name.equals("") &&
		       title != null && ! title.equals("");
	}
}
 
G

Guest

Gast
hmmm vieleicht das useBean blabla ganz an den anfang der seite schreiben .... also vor allen html code.
ist das ein kopiertes beispiel oder alles selbst gecoded?
 

WeirdAl

Bekanntes Mitglied
Hi,
in der Fehlermeldung steht doch alles drin. Eine Standardaction ist fehlerhaft. Die <jsp:useBean/> ist solch eine Standardaction und da die case sensitive ist, ist deine <jsp:usebean> "invalid".

Cu
Alex
 
G

Guest

Gast
:applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus:
 
Status
Nicht offen für weitere Antworten.

Ähnliche Java Themen

Neue Themen


Oben