Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

which jar file am I missing..

Status
Not open for further replies.

bluepixie

Programmer
Jul 31, 2003
34
US
Hi,
When I try to compile I get this:

C:\Tomcat_4_1\webapps\pixieapp>javac GuestbookForm.java
GuestbookForm.java:16: illegal start of expression
public String setGuestName(String guestname){
^
GuestbookForm.java:33: ';' expected
}
^
GuestbookForm.java:4: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionForm;
^
GuestbookForm.java:5: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionMapping;
^
GuestbookForm.java:7: cannot resolve symbol
symbol : class ActionForm
location: class pixie.GuestbookForm
public class GuestbookForm extends ActionForm {
^
5 errors
--------------------
What .jar file am I missing?
here is my code FYI:
--------------------------
package pixie;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class GuestbookForm extends ActionForm {

private String guestname = null;
private String comment = null;

public String getGuestName(){
return (guestname);
{

public String setGuestName(String guestname){
this.guestname = guestname;
{

public void getGuestComment(){
return (comment);
{

public void setGuestComment(String comment){
this.comment = comment;
{

public void reset(ActionMapping mapping,HttpServeletRequest request) {

this.guestname = null;
this.comment = null;
}
}
---------------------------
Thanks!!!
 
OK, I have fixed all of my problems byu putting the struts.jar in the jdkx.x/jre/lib/ext folder.

But I am stil getting these 2 errors which I cannot figure out:

C:\Tomcat_4_1\webapps\pixieapp>javac GuestbookForm.java
GuestbookForm.java:16: illegal start of expression
public void setGuestName(String guestname){
^
GuestbookForm.java:33: ';' expected
}
^
2 errors
--------------
my code
-------------
package pixie;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class GuestbookForm extends ActionForm {

private String guestname = null;
private String comment = null;

public String getGuestName(){
return (guestname);
{

public void setGuestName(String guestname){
this.guestname = guestname;
{

public String getGuestComment(){
return (comment);
{

public void setGuestComment(String comment){
this.comment = comment;
{

public void reset(ActionMapping mapping,HttpServeletRequest request) {
this.guestname = null;
this.comment = null;
}
}
Thanks!
 
There are typos in your code, you typed open brace instead of close brace.
see correction below:

package pixie;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class GuestbookForm extends ActionForm {

private String guestname = null;
private String comment = null;

public String getGuestName(){
return (guestname);
}

public void setGuestName(String guestname){
this.guestname = guestname;
}

public String getGuestComment(){
return (comment);
}

public void setGuestComment(String comment){
this.comment = comment;
}
 
i know, I noticed and fixed that after I sent the post!
: P
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top