setContentType() for xml output

2001-05-31 Thread Wu, Ying (LNG-CIS)

I need to send a string which represents a xml file to browser, I need to
call response.setContentType(text/xml).  But it is at ActionServlet level
and is default to text/html.

1. Any idea?
2. I can do the output at MyAction.perform() level, but how to handle the
return type of this method?

Thanks.

Ying




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 7:06 AM
To: unlisted-recipients
Cc: [EMAIL PROTECTED]
Subject: RE: Form tag problem in VAJ 3.5.3 WTE with 1.0b2


Thanks John.

For now we simply stepped back to b1.
But maybe this indicates that your changes should be applied struts, so
that we can all benefit from it.

-hendrik



 Hi Hendrik,
 
 This is a 'feature' of WTE. To resolve it edit
 org.apache.struts.taglib.FormTag.doEndTag so the first two lines read
:
 
 // Remove the page scope attributes we created
 pageContext.removeAttribute(Constants.BEAN_KEY);
 pageContext.removeAttribute(Constants.FORM_KEY);
 
 This seems to resolve the issue, not sure if its the best way round it
 however.
 
 Jon.
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]
 Sent: 22 May 2001 06:40
 To: [EMAIL PROTECTED]
 Subject: Form tag problem in VAJ 3.5.3 WTE with 1.0b2
 
 
 Hi,
 
 we just downloaded and tried the new beta2 and experienced problems
with
 Visual Age Websphere Test Environement 3.5.3. It seems that it does
not
 allow to remove attributes from a request, which is apparently done by
 the form tag.
 
 Does anybody else have this problem?
 To me it seems like a bug in WTE.
 
 Cheers,
 
 -hendrik
 
 Here's the errormessage:
 
 Error ReportError 500
 An error has occured while processing 
 request:http://localhost:8080/CIC/index.jsp
 Message: Server caught unhandled exception from servlet [jsp]: cant
 remove 
 Attributes from request scope
 
 Target Servlet: jsp
 StackTrace: 
 
 Root Error-1: cant remove Attributes from request scope
 
 java.lang.IllegalArgumentException: cant remove Attributes from
request
 scope
  java.lang.Throwable(java.lang.String)
  java.lang.Exception(java.lang.String)
  java.lang.RuntimeException(java.lang.String)
  java.lang.IllegalArgumentException(java.lang.String)
  void

org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.Stri
 ng, int)
  int org.apache.struts.taglib.html.FormTag.doEndTag()
  void

_index_xjsp_debug_jspsrc_547983255._jspService(javax.servlet.http.HttpSe
 rvletRequest, javax.servlet.http.HttpServletResponse)
  void

org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpSer
 vletRequest, javax.servlet.http.HttpServletResponse)
  void
 javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
 javax.servlet.ServletResponse)
  void

org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.ser
 vlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse,
 boolean)
  void

org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.H
 ttpServletRequest, javax.servlet.http.HttpServletResponse,
 java.lang.String, java.lang.Throwable, boolean)
  void

org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServ
 letRequest, javax.servlet.http.HttpServletResponse)
  void
 javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
 javax.servlet.ServletResponse)
  void

com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.serv
 let.ServletRequest, javax.servlet.ServletResponse)
  void

com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.serv
 let.ServletRequest, javax.servlet.ServletResponse)
  void

com.ibm.servlet.engine.webapp.ServicingServletState.service(com.ibm.serv
 let.engine.webapp.StrictLifecycleServlet,
javax.servlet.ServletRequest,
 javax.servlet.ServletResponse)
  void

com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servl
 et.ServletRequest, javax.servlet.ServletResponse)
  void

com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.Serv
 letRequest, javax.servlet.ServletResponse,
 com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
  void

com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ib
 m.servlet.engine.webapp.ServletInstanceReference,
 javax.servlet.ServletRequest, javax.servlet.ServletResponse,
 com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
  void

com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.se
 rvlet.ServletRequest, javax.servlet.ServletResponse,
 com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
  void

com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispat
 ch(com.ibm.servlet.engine.webapp.WebAppRequest,
 javax.servlet.http.HttpServletResponse, boolean)
  void

com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.ser
 vlet.ServletRequest, javax.servlet.ServletResponse, boolean)
  void

com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.serv
 let.ServletRequest, 

output xml file

2001-05-31 Thread Wu, Ying (LNG-CIS)

I need to send a string which represents a xml file to browser, I need to
call response.setContentType(text/xml).  But it is at ActionServlet level
and is default to text/html.

1. Any idea?
2. I can do the output at MyAction.perform(, request, response, ) level, but
how to handle the return type of this method?

Thanks.

Ying