Hi Members,

Im getting this error,

null: java.lang.NullPointerException at com.neto2.attest.tpm.RegressionListByAjaxAction.ex ecute(RegressionListByAjaxAction.java:88) at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:419) at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:224) at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1196) at com.neto2.attest.usm.ui.UsmServlet.process(UsmServ let.java:62) at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet .java:709) at javax.servlet.http.HttpServlet.service(HttpServlet .java:802) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173) at org.apache.struts2.dispatcher.FilterDispatcher.doF ilter(FilterDispatcher.java:413) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)
Here is my code:

JSP page 1:

<html:form action="showCharacters.do">
TV Show:
<html:select property="TVShowSelect"
onchange="retrieveURL(' showCharacters.do?tvShow=' + this.value);">
<html:option value="Lissie Maguire"> Lissie Maguire </html:option>
<html:option value="That�s so Raven"> That�s so Raven </html:option>
<html:option value="Dhoom machale"> Dhoom machale </html:option>
</html:select>
<br>
Characters: <span id="characters"></span>
</html:form>


Struts-config.xml:

<action path="/showCharacters " type="ShowTVAction" validate="false" >
<forward name="success" path="/pages/showCharacters.jsp" />
</action>


Action.java:

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

// Get a list of characters associated with the select TV show
String tvShow = (String)request.getParameter("tvShow");
if (tvShow == null) {
tvShow = "";
}
ArrayList characters = getCharacters(tvShow);
request.getSession().setAttribute("characters", characters);
response.setContentType("text/html");
return mapping.findForward("success");
} // End execute()


Success.JSP:

<html:select property="TVShowSelect">
<logic:present name="characters">
<%ArrayList ch = (ArrayList) request.getSession().getAttribute("characters");
String[] s = new String[ch.size()];
ch.toArray(s);
for(int i=0;i<s.length;i++)
{%>
<html:option value ="<%=s[i] %>" ></html:option>
<%} %>
</logic:present>
</html:select>


Javascript Ajax code:

function processStateChange() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
document.getElementById("characters").innerHTML = req.responseText;
} else {
alert("Problem: " + req.statusText);
}
}
}

But by doing like this im getting the error above......

Please help me out in this.....

Thanks and Regards,
Prabhu.