• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaEE(eclipse,struts)

 
krithika chandrasekar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually i'm getting the syntax error when i'm creating struts application using eclipse.
Tools used:
1)jdk 1.5
2)Tomcat 6.x
3)eclipse ganymede latest version
4)Apache Struts JAR files:list of JAR files used are:
struts.jar
common-logging.jar
common-beanutils.jar
common-collections.jar
common-digester.jar

During the creation of class(LoginAction) i'm getting the following errors:

Description ResourcePathLocationType
amp cannot be resolvedLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
amp cannot be resolved to a typeLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
amp cannot be resolved to a typeLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
amp cannot be resolved to a typeLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
amp cannot be resolved to a typeLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Duplicate local variable ampLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Duplicate local variable ampLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Duplicate local variable ampLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Syntax error on token ";", delete this tokenLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Syntax error on token ";", delete this tokenLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Syntax error on token ";", delete this tokenLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Syntax error on token ";", delete this tokenLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Syntax error on token ")", ; expectedLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Syntax error on token "&", assert expectedLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem
Syntax error on token "else", delete this tokenLoginAction.javastrutsexample/src/struts/example/actionline 27Java Problem
Syntax error, insert ") Statement" to complete IfStatementLoginAction.javastrutsexample/src/struts/example/actionline 23Java Problem

class LoginAction
package struts.example.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import struts.example.form.LoginForm;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class LoginAction extends Action {

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

String target = null;
LoginForm loginForm = (LoginForm)form;
if(loginForm.getUserName().equals("admin")
&& loginForm.getPassword().equals("admin123")) {
target = "success";
request.setAttribute("message", loginForm.getPassword());
}
else {
target = "failure";
}

return mapping.findForward(target);
}

}
please help me to remove these errors.i thank you in advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34668
366
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by krithika chandrasekar:
&& loginForm.getPassword().equals("admin123")) {

What are you expecting this do be? & isn't a Java keyword. It looks like it snuck into your code via an editor before compiling.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic