[JBoss Seam] - [1.3 cvs] Trinidad svg generation error
by wesleyhales
I copied the chart demo code from the trinidad-demo in the Apache subversion repo to my current 1.3 cvs app. Everything works and renders fine, but the charts don't actually show up. All the adf resources and javascript data are showing up correctly on the app server also. So I tried to open the actual svg/xml file in my browser (http://myapp/adf/svg/chart.svg) and I get...
anonymous wrote :
| XML Parsing Error: not well-formed
| Location: http://localhost:8080/freedom/adf/svg/chart.svg
| Line Number 1, Column 2:<?xml version="1.0" encoding="UTF-8"?>
|
You can view the well formed svg document in the trinidad live demo here: http://www.irian.at/trinidad-demo/adf/svg/chart.svg
Notice the 3 characters in front of the first < sign...Would this be a issue with one of the filters?
here is my web.xml:
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <servlet>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <!-- JSF -->
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| <!-- Trinidad - as suggested by a4j-trinidad example-->
|
| <context-param>
| <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
| <param-value>com.sun.facelets.FaceletViewHandler</param-value>
| </context-param>
|
| <filter>
| <filter-name>Trinidad</filter-name>
| <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Trinidad</filter-name>
| <url-pattern>*.seam</url-pattern>
| <dispatcher>REQUEST</dispatcher>
| <dispatcher>FORWARD</dispatcher>
| <dispatcher>INCLUDE</dispatcher>
| </filter-mapping>
|
| <context-param>
| <param-name>
| org.apache.myfaces.trinidad.CACHE_VIEW_ROOT
| </param-name>
| <param-value>false</param-value>
| </context-param>
|
| <servlet>
| <servlet-name>Trinidad Resources</servlet-name>
| <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Trinidad Resources</servlet-name>
| <url-pattern>/adf/*</url-pattern>
| </servlet-mapping>
|
| <listener>
| <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
| </listener>
|
| <session-config>
| <session-timeout>10</session-timeout>
| </session-config>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057529#4057529
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057529
18Â years, 10Â months
[JBossWS] - Re: change HTTP status code in a WS fault
by axstevens
Something along the following lines if you can configure in a filter.
But to a previous posters point. How do you get a filter configured when @WebService is a Session Bean, nice <web-app> example in user guide is for POJO. I guess use HTTP request/response context properties in SOAPHandler? Haven't looked to see if they are popuated yet.
But anyway kind of problemattic with a lot of servlet filter resources already written for authentication, etc.
public class AdobeStatusFilter implements Filter {
| Logger log = Logger.getLogger(AdobeStatusFilter.class);
| private FilterConfig filterConfig = null;
|
| public void init(FilterConfig filterConfig) throws ServletException {
| this.filterConfig = filterConfig;
| }
|
| public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
| AdobeResponseWrapper wrapper = new AdobeResponseWrapper((HttpServletResponse) resp);
| HttpServletResponse response = (HttpServletResponse)resp;
| chain.doFilter(req, wrapper);
| }
|
| public void destroy() {
| this.filterConfig = null;
| }
|
| }
public class AdobeResponseWrapper extends HttpServletResponseWrapper {
|
| private int statusCode;
| public AdobeResponseWrapper(HttpServletResponse response) {
| super(response);
| }
| public int getStatus() {
| return statusCode;
| }
| public void sendError(int errorCode) throws IOException {
| this.statusCode = adjust(errorCode);
| super.sendError(this.statusCode);
| }
| public void sendError(int errorCode, String errorMessage) throws IOException {
| this.statusCode = adjust(errorCode);
| super.sendError(this.statusCode, errorMessage);
| }
| public void setStatus(int statusCode) {
| this.statusCode = adjust(statusCode);
| super.setStatus(this.statusCode);
| }
| public void setStatus(int statusCode, String message) {
| this.statusCode = adjust(statusCode);
| super.setStatus(this.statusCode, message);
| }
|
| private int adjust(int errorCode) {
| return errorCode == HttpServletResponse.SC_INTERNAL_SERVER_ERROR ?
| HttpServletResponse.SC_OK : errorCode;
| }
|
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057524#4057524
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057524
18Â years, 10Â months