aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes JavaEE(eclipse,struts) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "JavaEE(eclipse,struts)" Watch "JavaEE(eclipse,struts)" New topic
Author

JavaEE(eclipse,struts)

krithika chandrasekar
Greenhorn

Joined: Dec 15, 2008
Posts: 1
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

Joined: May 26, 2003
Posts: 30752
    
156

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaEE(eclipse,struts)