Bookmark Topic Watch Topic
  • New Topic

Invalid Standard Action - Error

 
Saravanan Jothimani
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Report post to moderator
I got this error when I run my application

org.apache.jasper.JasperException: /sample/secondprogram/firstpage.jsp(16,5) Invalid standard action
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:90)
org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1249)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1559)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

My JSP program

<%@ page language="java" %>
<%@ page session="true"%>


<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title> New Page 1</title>
</head>

<body>
<jsp:usebean id="dbconn" scope="page" class="src.dbConnection"/>
<%
out.println("Inside JSP");

String user = "hello";
String pass = "hai";
String sessionid;

String username = request.getParameter("txtusername");
String password = request.getParameter("txtpassword");
if ((username.length()>0) && (password.length()>0))
{
if ((username.equals(user)) &&(password.equals(pass)))
{
out.println(username);
out.println(password);

sessionid = session.getId();
session.setAttribute("sessionid", sessionid);
}
else
{
out.println("The user and password are not valid");
}
}
else
{
out.println("The username & password field is empty");
}
%>
<form method="POST" action="secondpage.jsp">
<input type= "submit" name="Click">
</form>
</body>

</html>


Help Me

Thanks in Advance

Saravanan
 
Saravanan Jothimani
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Report post to moderator
I got my friends advice and I have corrected the error.

Please send me the folder structure for JSP program.

Now I am getting another error in useBean tag.

The value for the useBean class attribute com.dbConnection is invalid.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by Saravanan Jothimani:
I got my friends advice and I have corrected the error.

Please send me the folder structure for JSP program.

Now I am getting another error in useBean tag.

The value for the useBean class attribute com.dbConnection is invalid.


There must be a getter/setter for every property in your bean, in order to use that property in usebean tag.
 
Raghuram Srinivas
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi Saravanan ,
The classes in <jsp:useBean> must always be with in a package.I am assuming you have kept the file "dbConnection" under the "src" directory. Try placing it under a package under "src" directory.
eg : src/mypackage/dbConnection.class and dont forget to put the
"package mypackage;" in the dbConnection.java!!

Also there are chances for a NullPointerException at
"if ((username.length()>0) && (password.length()>0))"
replace with (username!= null && password != null )

hope this helps

~Raghuram
 
Arunkumar Chinnadurai
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Report post to moderator
Saravanan Jothimani wrote:I got my friends advice and I have corrected the error.

Please send me the folder structure for JSP program.

Now I am getting another error in useBean tag.

The value for the useBean class attribute com.dbConnection is invalid.



Please share that answer....now i`m strugling with this
 
Prasad Krishnegowda
Ranch Hand
Posts: 671
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Arunkumar Chinnadurai wrote:
Please share that answer....now i`m strugling with this

The thread is 6 Years Old, so its very unlikely, that the OP will be watching this thread.
You would get helpful replies, if you create your own topic and TellTheDetails...
 
    Bookmark Topic Watch Topic
  • New Topic