Tuesday, February 27, 2007
The reel Sweetxml
Posted by Sweetxml at Tuesday, February 27, 2007 0 comments
Portlet Resources using clean JSTL
Since I'm a great fan of XML I prefer to write my JSP pages as XML, since it guarantees wellformed markup and makes it easier to find errors in JSP's at development time (ant task to check for wellformedness) and naturally all the normal advantages of scriptlet free pages. This is also valid for my JSP's for my portlets and JSTL once more proved value to me when I had to reference a static resource (and image). In the test portlet application that comes with WSRP4J it's written as:
<IMG SRC=<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/images/project-logo.jpg")%>" align="TOP" />
Adhering to best practice with URLencoding, this can be achived with JSTL:
<c:url var="imageUrl" context="${renderRequest.contextPath}" value="/images/project-logo.jpg" /> <img src="${imageUrl}" />
Easy and clean just as it should be. The only improvement I can think of would be to ectend the portlet taglib to include an image tag that would do it automatically in one simpel tag, like:
<portlet:img src="/images/project-logo.jpg" />
much like Struts and Spring.
Posted by Sweetxml at Tuesday, February 27, 2007 0 comments
Sunday, February 25, 2007
Pluto 1.0.1 and web-app 2.4
Feb 25, 2007 12:34:26 PM org.apache.pluto.portalImpl.services.log.LoggerImpl error SEVERE: Error in Portlet java.lang.NullPointerException at org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:109) at org.apache.pluto.invoker.impl.PortletInvokerImpl.load(PortletInvokerImpl.java:80) at org.apache.pluto.PortletContainerImpl.portletLoad(PortletContainerImpl.java:218) at org.apache.pluto.portalImpl.core.PortletContainerWrapperImpl.portletLoad(PortletContainerWrapperImpl.java:94) at org.apache.pluto.portalImpl.aggregation.PortletFragment.service(PortletFragment.java:120) at org.apache.jsp.WEB_002dINF.aggregation.ColumnFragment_jsp._jspService(ColumnFragment_jsp.java:76) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.pluto.portalImpl.aggregation.AbstractFragment.service(AbstractFragment.java:112) at org.apache.jsp.WEB_002dINF.aggregation.RowFragment_jsp._jspService(RowFragment_jsp.java:76) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.pluto.portalImpl.aggregation.AbstractFragment.service(AbstractFragment.java:112) at org.apache.jsp.WEB_002dINF.aggregation.PageFragment_jsp._jspService(PageFragment_jsp.java:85) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.pluto.portalImpl.aggregation.AbstractFragment.service(AbstractFragment.java:112) at org.apache.jsp.WEB_002dINF.aggregation.RootFragment_jsp._jspService(RootFragment_jsp.java:147) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.pluto.portalImpl.aggregation.AbstractFragment.service(AbstractFragment.java:112) at org.apache.pluto.portalImpl.Servlet.doGet(Servlet.java:254) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) at java.lang.Thread.run(Thread.java:595)I had an idea that web-app versions might be a problem, and had it running when i changed to version 2.3, I then changed it to 2.4 and redeployed and i still worked, but that was probably due to me lack of understanding on redeploying to tomcat. Any how it's also described in the mail archives (this from the google cache) Re: Supporting web.xml with 2.4 XSD The solution was to only put the version="2.4" attribute on the <web-app> tag and not the namespace information. Now I'll have to make sure everything else works without the namespace attributes. That's right for me as well. Now I'm not sure wether it'll actually run as a 2.4 web-app in tomcat, but time will show.
Posted by Sweetxml at Sunday, February 25, 2007 0 comments
Tuesday, February 13, 2007
First entry at blog.sweetxml.org aka sweetxml.blogger.com
Posted by Sweetxml at Tuesday, February 13, 2007 0 comments