You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by tomate_61 <to...@163.com> on 2008/06/09 14:34:54 UTC

Use "plainText" result for Ajax

hi,
  I used Ajax in my .jsp page for getting "plainText" data from action.

  In my struts.xml, I config my action like this:
     <action name="myAction" class="com.myWeb.MyAction">
	<result type="plainText"></result>
     </action>

  My webApp works well when deployed in tomcat. But in "Eclipse->Run As->Run
On Server" model, I get some Exception like behind:
  SEVERE: Servlet.service() for servlet default threw exception
  java.lang.NullPointerException
	at java.io.Reader.<init>(Unknown Source)
	at java.io.InputStreamReader.<init>(Unknown Source)
	at
org.apache.struts2.dispatcher.PlainTextResult.doExecute(PlainTextResult.java:148)
	at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
	at com.opensymphony.xwork2.DefaultActionInvocation...     ......

  For fixing this Exception, I create a total blank jsp page "blank.jsp" ,
and modify struts.xml:
     <action name="myAction" class="com.myWeb.MyAction">
	<result type="plainText">/blank.jsp</result>
     </action>

  I don't think this is a good way to solve problem. And is there some miss
in struts for supporting Ajax?

thx a lot
-- 
View this message in context: http://www.nabble.com/Use-%22plainText%22-result-for-Ajax-tp17731935p17731935.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org