Compilation error in java for struts application.

Hello,

I'm a newbie in java and struts, i was trying a simple struts application given in "struts complete reference".This is my code of its Controller class(Action class):-

package com.jamesholmes.struts;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

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 final class SearchAction extends Action

{

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

throws Exception

{

EmployeeSearchService service = new EmployeeSearchService();

ArrayList results;

SearchForm searchForm = (SearchForm) form;

//Perform employee search based on what criteria was entered.

String name = searchForm.getName();

if(name != null && name.trim().length() > 0)

{

results = service.searchByName(name);

}

else

{

results = service.searchBySsNum(searchForm.getSsNum().trim());

}

//place search results in SearchForm for access by jsp.

searchForm.setResults(results);

//Forward control to this Action's input page.

return mapping.getInputForward();

}

}

Now problem is when i'm compiling this java file i'm getting error"can not resolve symbol" for the instances i'm creating for SearchForm(view class) and EmployeeSearchService(model class).can any one help me how to resolve this error. I've tried importing those classes explicitly also, but error gets increased this way.

[1802 byte] By [Garva] at [2007-11-27 4:56:45]
# 1
Can you give more specifics about those classes?
kdajania at 2007-7-12 10:11:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

Ok,

Its like SearchForm is my view class and EmployeeSearchService is model class in the struts application.instances of both the classes in needed in action class i.e "SearchAction".all the files r in same package and i guess its a simple thing in java crating instances of classes in the same package(if it is public or protected).And what kind of specifications u r askin plz elaborate, if u want i'll post all the java file here frm the application?

Garva at 2007-7-12 10:11:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3
Yes please, can you post the code for SearchForm(view class) and EmployeeSearchService(model class) ? The exact error as well please.Message was edited by: kdajani
kdajania at 2007-7-12 10:11:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4

Tht problem is solved, it was a mistake frm my side in compilation precedure.Anyway, now the real error-After i compiled and created the war file of application, i was running it in tomcat and got this Error, it is i guess a server sprcific error which i am unable to understand., can any one now help me solving this out?Error is this :-

HTTP Status 500 -

--

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)

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)

root cause

java.lang.NullPointerException

org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:521)

org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:436)

org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:495)

org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)

org.apache.jsp.index_jsp._jspx_meth_html_link_0(index_jsp.java:96)

org.apache.jsp.index_jsp._jspService(index_jsp.java:69)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

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)

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.

--

Apache Tomcat/5.0.27

Garva at 2007-7-12 10:11:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...