Home arrow static arrow Java Programming [Archive] - Struts Help
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Struts Help
This topic has 6 replies on 1 page.

Posts:57
Registered: 6/15/04
Struts Help  
Jul 28, 2004 12:02 AM



 
Hi Friends,

I just atarted Struts.

I am lerning Struts from http://www.reumann.net/do/struts/main

Lesson1
1.Tomcat already installed
2.created app directory
3.added Strut files(downloaded jakarta-struts-1.1[1].zip and added tld and jar files in WEB-INF and lib directory respectively)
4.created DTO(Bean)
From Step5 onwards , I am having problems
5.I am creating business service but it's not getting compiled?
6.Creating action form but having problems with
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

How to go about it?

Which form to refer for Struts?

Thanx

Pooja
 

Posts:1,695
Registered: 1/13/04
Re: Struts Help  
Jul 28, 2004 12:25 AM (reply 1 of 6)



 
Could you post a sample code of what you did in the steps(5) and (6) ?
 

Posts:57
Registered: 6/15/04
Re: Struts Help  
Jul 28, 2004 12:37 AM (reply 2 of 6)



 
Hi,

In step 5 i wrote the code

package net.reumann;

public class EmployeeService
{
public EmployeeDTO insertEmployee( EmployeeDTO employee ) {
return employee;
}
}

and saved as EmployeeService.java in WEB-INF\classe\net\reumann folder

In step 6 I am writing the same code as from the site of Reumann
but I am getting the error

package org.apache.struts.action does not exist

why is it so?

i know i have missed some code somewhere but where and what code?

Thanx for help

Pooja
 

Posts:27
Registered: 8/21/03
Re: Struts Help  
Jul 28, 2004 1:00 AM (reply 3 of 6)



 
first thing is : Folder is wrong

instead of WEB-INF\classe\net\reumann

put you source code in WEB-INF\src\net\reumann
 

Posts:57
Registered: 6/15/04
Re: Struts Help  
Jul 28, 2004 2:03 AM (reply 4 of 6)



 
hi,

I placed the EmployeeDTO.java as well as EmployeeService.java in WEB-INF\src\net\reumann folder
the code is as follows

EmployeeDTO.java
package net.reumann;

public class EmployeeDTO
{
private String name;
private int age;

public void setName(String name)
{
this.name=name;
}

public void setAge(int age)
{
this.age=age;
}

public String getName()
{
return name;
}
public int getAge()
{
return age;
}

}

EmployeeService.java
package net.reumann;

public class EmployeeService
{
public EmployeeDTO insertEmployee( EmployeeDTO employee )
{
return employee;
}
}

still ,I am getting the same error

cannot resolve symbol : class EmployeeDTO
location: class net.reumann.EmployeeService
public EmployeeDTO insertEmployee( EmployeeDTO employee )

How to go about it?

Thanx

 

Posts:56
Registered: 5/16/03
Re: Struts Help  
Jul 28, 2004 4:35 AM (reply 5 of 6)



 
Seems like a classpath problem..

1. do u have WEB-INF\src\ in your classpath?

2. Have u compiled EmployeeDTO before compiling EmployeeService?
 

Posts:56
Registered: 5/16/03
Re: Struts Help  
Jul 28, 2004 4:37 AM (reply 6 of 6)



 
Seems like a classpath problem..

1. do u have WEB-INF\src\ in your classpath?

2. Have u compiled EmployeeDTO before compiling EmployeeService?
 
This topic has 6 replies on 1 page.