JSP 2.0 as JSF component encoders - continued

This is in continuation to this topic:
http://forum.java.sun.com/thread.jsp?forum=427&thread=414850&tstart=15&trange=15
As I look further into JSP 2.0, I am more and more sold to the idea of encoding JSF components thru JSP 2.0 tag files and/or SimpleTag handlers ...
Like, I was trying to figure out how could I derive the functionality of JSF facets from JSP tags - and the answer was amazingly straightforward - fragment attributes ... the tag could treat the fragments as facets while evaluating the body with its normal course ...
If the benefits of tag files/simple tag handlers are felt among the JSF team, I was wondering if the tag file/simple tag handler could be made part of the JSF rendererType paradigm?
I was wondering if it were a feasible idea to work in encoder-decoder pairs? The declarations in faces-config.xml for the renderers could be something along these lines:
If the encoding was with a simple tag handler:
<render-kit>
  <renderer>
    <renderer-type>Component1Renderer</renderer-type>
    <decoder>decoder.Component1Decoder</decoder>
    <encoder type="SimpleTagHandler">encoder.Component1EncoderTag</encoder>
  </renderer>
</render-kit>
If the encoding was with a tag file:
<render-kit>
  <renderer>
    <renderer-type>Component1Renderer</renderer-type>
    <decoder>decoder.Component1Decoder</decoder>
    <encoder type="TagFile">/WEB-INF/tags/component1Encoder.tag</encoder>
  </renderer>
</render-kit>
The above may all be very far fetched but I thought I'd just put across what I had in mind.
Thanks!

This is in continuation to this topic:
http://forum.java.sun.com/thread.jsp?forum=427&thread=4
4850&tstart=15&trange=15
As I look further into JSP 2.0, I am more and more
sold to the idea of encoding JSF components thru JSP
2.0 tag files and/or SimpleTag handlers ...
As has been pointed out by others, this isn't feasible at all unless JavaServer Faces were to choose JSP 2.0 as the minimum platform. However, even if that were to happen, there are some crucial problems in at least two dimensions:
* JavaServer Faces integrates nicely with JSP, but does not
require it. Therefore, the encoding functionality of a
component (or renderer) needs to operate correctly even for
a non-JSP rendering environment. How can that be reconciled
with a desire to use JSP-specific rendering capabilities?
* JSP 2.0 is very cool, but it doesn't deal at all with the
issue of handling an incoming request. Therefore,
a solution that uses JSP as a templating environment (which
violates the "don't require JSP requirement as mentioned in
the previous paragraph"), will STILL require some non-JSP
functionality to do the decoding, validation, and event handling
parts of the application. To me, it does NOT seem like forcing
component writers to master two technologies (instead of one)
would make JavaServer Faces easier to use.
Implementation technology aside, the logic of decoding (what request parameters do I look at?) is very tightly coupled with the logic of encoding (what markup do I generate?). Splitting those two aspects of the problem into different source files, implemented with different technologies, and requiring changes in both placeds when you make changes, seems like something that goes against all the best practices design principles we've all been learning over the past several decades.
If JSP had a way to express the functional logic needed for handling events, validations, and calls to business logic, I might be more sympathetic to this approach -- but it doesn't. It is also interesting to note that Struts (among many other frameworks) has embedded markup generation for user interface components in Java logic (in the case of Struts, it's in the HTML tag library) from the very beginning. Why should it be OK there (and 75,000 downloads per month says it's pretty popular) and not in JavaServer Faces?
Further, why should a page author that is just using components give a rip what the implementation technology is? Isn't that a concern solely of the component writer? I would contend that anyone who builds a non-trivial component, in any technology framework, is going to need functional programming knowledge (be it Java, VB, C#, some XML-based variant, JavaScript, whatever) anyway. Rendering is about 20% of the problem -- the 80% that still needs to be solved is going to require programming knowledge anyway. And JSP, even with all the fantastic things added in 2.0, doesn't address any of those needs.
Craig McClanahan

Similar Messages

  • Using JSP scriplets in the JSF tags

    Hi,
    I haven't done that much JSP development using various tag libraries prior to looking at JSF, hence this very basic question:
    I am declaring and manipulating Java variables in my JSP. Is there a way to access those in my JSF tags? It seems that something like:
    <%
    String myString="MyLabel";
    %>
    <h:view>
    <h:outputText id="myID" value="<%=myString%>" />
    </h:view>
    blows up in the JSF processor.
    I am porting some stuff to JSF and hence do not use backing beans in all cases.
    Any suggestions/ideas/pointers are greatly appreciated.
    Thanks in advance,
    Vadim.

    JSF action element attributes take JSF EL expressions, not Java expressions. A JSF EL expression has access to objects in one of request, session or application scope only, not to scripting variables. One way to get your example to work is by putting the String in one of these scopes within the scriptlet, e.g.:
    <%
      String myString="MyLabel";
      request.setAttribute("myString", myString);
    %>
    <h:view>
      <h:outputText id="myID" value="#{myString}" />
    </h:view>But, if you're porting a JSP-based application to JSF, I strongly recommend that you move all scriptlet code into beans; otherwise it's kind of pointless to migrate to JSF. The strength of JSF is its separation of UI layout and application logic.
    Even though JSP happens to be one way to wire up a JSF view with JSF components, JSF has very little to do with JSP. You need to understand the basic JSF component model, event-driven development, and use JavaBeans to really gain any benefits. Don't be fooled into believing that JSF is "just a new JSP tag library" by the support for JSP as the default presentation layer; it's far more than that, and I personally believe that using JSP as the presentation layer makes using JSF a lot harder than it should be. In fact, most of the issues posted in this forum are issues with the JSP layer, not with the core JSF components or the infrastructure classes.
    Hans Bergsten (EG member)

  • Tomcat and refreshing jsf component attributes in the browser

    I'm using Eclipse and Tomcat 5.0.25. I start Tomcat in debug mode with a shortcut: "C:\Tomcat-5.0\bin\catalina.bat jpda start". I have an entry in the Tomcat server.xml file that points to my web application:
    <Context debug="0" docBase="C:\MyProjects\eclipse\cdstore\WebContent" path="/cdstore" reloadable="true"/>
    I have a jsp page with a jsf dataTable tag. If I change the html markup (i.e. by typing "hello" in the jsp page) and press the refresh button in my IE 6.0 browser, the "hello" message is displayed.
    If, however, I change the content of a dataTable attribute (i.e. I change styleClass="aClass" to styleClass="anotherClass") or add a new dataTable attribute, the attribute changes are not sent to the browser when I press the browser refresh button. I do a "view html source" and they are not there.
    I have to close the browser down and relaunch the browser to see the new dataTable attributes.
    Does anybody know if there is any easier way of doing this?
    thanks, jeff

    Hi pushpa latha
    Yes it is possible to update the data at the header level using below approach
    create the component interface for your cusotm component
    use the component interface  in the header overview standard component as resuable component.
    Implement the event handler method for the button , in the event handler method get the refreshed value
    create the navigation and call the navigation (fire_outbond_plug) to cutom component by passing the plug name and refreshed data..
    set the refreshed data to your value node in your custom component.
    Thanks & Regards
    Raj

  • Simple JSF component

    Im using a simple JSF component <h:selectOneMenu> decribed below:
    <h:selectOneMenu value = "Tuesday">
         <f:selectItem itemValue="Sunday" />
         <f:selectItem itemValue="Monday" />
         <f:selectItem itemValue="Tuesday" />
         <f:selectItem itemValue="Wednesday" />
         <f:selectItem itemValue="Thursday" />
    </h:selectOneMenu>I use this component in a simple .jsp with nothing else in it. Im tring test the waters. My development environment is WSAD 5.1. When I try to run the .jsp on my test server, I get the following error: (Any idea as to why?)
    [6/21/05 17:11:17:891 EDT]  bc09ee3 WebGroup      I SRVE0180I: [FACES_Test] [/FACES_Test] [Servlet.LOG]: /JSFTestApp.jsp: init
    [6/21/05 17:11:17:953 EDT]  bc09ee3 WebGroup      E SRVE0026E: [Servlet Error]-[Argument Error: One or more parameters are null.]: javax.servlet.jsp.JspException: Argument Error: One or more parameters are null.
         at com.sun.faces.taglib.html_basic.SelectOneMenuTag.doEndTag(SelectOneMenuTag.java:483)
         at org.apache.jsp._JSFTestApp._jspService(_JSFTestApp.java:342)
         at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    .........

    OK, I figured this out. I made a newbie mistake. I should be using the itemLabel attribute like this <f:selectOneMenu itemLabel = "Sunday" itemValue = "Sunday">
    I think.....

  • GetStyle() of JSF component before render

    Hey guys,
    I'm hoping this is an easy one, here goes...
    For one reason or another, I need to modify the CSS of certain components in a JSF page before it is rendered to the browser. The JSF pages are going to be laid out in Netbeans 6.0 (beta right now) using mostly Woodstock components and will have the 'style' attribute filled in for each component. However, like I said, I want to modify the CSS style value of some components prior to rendering.
    Looking through the Javadocs for Woodstock (javadocs are included with plugin) I see that many components do indeed give you access to this attribute ('style'), com.sun.webui.jsf.component.Field.getStyle() returns "CSS style(s) to be applied to the outermost HTML element when this component is rendered" for example.
    I figured this would be straight forward enough and attempted to retrieve the style using the prerender() method. Unfortunately, getStyle() returned null. After playing around with it for a while, it appears as though the components do not get these properties set (by the Netbeans attribute) until DURING the renderResponse phase. I say this because I tried setStyle() during prerender() and my changes were ignored. I then went back to Netbeans and removed my 'suggested style', now my setStyle() call during prerender() holds showing that somewhere in the renderResponse phase (after prerender()) the style is being set if one is given.
    Obviously making any changes after prerender() [like in afterRenderResponse()] will not cut it.
    To sum up:
    Even as late in the lifecycle as prerender(), the CSS style attribute of a Woodstock component is not yet set (getStyle() returns null and setStyle() ends up being overwritten). Any suggestions on how to modify the style?
    Thanks in advance (and I hope this is an applicable forum),
    Sean

    Solved:
    Once I wrapped my head around the problem I found a much more elegant solution.
    What I wanted to do was relatively position page fragments but was having trouble as the Netbeans IDE positions components within fragments absolutely. To make my page dynamic I was taking the style="position: absolute" attribute out of the <div> tag that was holding the <jsp:directive-include>. The components within the fragments were then being positioned absolutely on the resulting page, ending up strewn all over the place. This led me off on the tangent to reposition the components when the page was called (original post above).
    The weekend did me well I suppose. I came up with the bright idea to CHANGE the style attribute on the <div> tag rather than remove it. Making the <div> component "position: relative" passed its positioning down the the containing components and now my fragments are displayed correctly while being dynamically repositionable.
    Hope this helps anyone coming across the same problem.

  • Need help going to error page from jsf component value change event

    Afternoon all,
    I have a jsp page which uses jsf components and when one of the jsf combo boxes components handles an value change event, the method 'handleTestComboValueChange' is fired.
    Within this method if an error is caught I would like to display an error page instead of the currently displayed page.
    Can some one tell me how to do this. I tried to use getFacesContext().getExternalContext().redirect("errorpage.jsp"); but I just got an illegalStackException error.
    Any help would be great.
    Thanks in advance,
    Lex

    log output listed below...
    [14/04/06 14:52:48:781 BST] 6b0ec4d8 ProcessValida E com.sun.faces.lifecycle.ProcessValidationsPhase com.sp.exceptions.ServicePackagesException: My custom error message
    [14/04/06 14:52:48:812 BST] 6b0ec4d8 ProcessValida E com.sun.faces.lifecycle.ProcessValidationsPhase TRAS0014I: The following exception was logged javax.faces.el.EvaluationException: com.sp.exceptions.ServicePackagesException: My custom error message
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
         at javax.faces.component.UIInput.broadcast(UIInput.java:492)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:252)
         at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:346)
         at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at com.ibm.faces.webapp.FacesGenericPortlet.execute(FacesGenericPortlet.java:637)
         at com.ibm.faces.webapp.FacesGenericPortlet.processAction(FacesGenericPortlet.java:142)
         at com.scottishpower.portlet.GoldenAccountPortlet.processAction(GoldenAccountPortlet.java:143)
         at com.ibm.wps.pe.pc.std.cmpf.impl.PortletFilterChainImpl.processAction(PortletFilterChainImpl.java:104)
         at com.ibm.wps.propertybroker.standard.filter.PropertyBrokerActionFilter.processAction(PropertyBrokerActionFilter.java:260)
         at com.ibm.wps.pe.pc.std.cmpf.impl.PortletFilterChainImpl.processAction(PortletFilterChainImpl.java:95)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletServlet.dispatch(PortletServlet.java:148)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletServlet.doPost(PortletServlet.java:76)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at com.ibm.wps.pe.pc.std.cache.CacheablePortlet.service(CacheablePortlet.java:257)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1095)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:254)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:204)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:168)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.action(PortletInvokerImpl.java:82)
         at com.ibm.wps.pe.pc.std.event.ActionEvent.execute(ActionEvent.java:111)
         at com.ibm.wps.pe.pc.std.event.EventQueueManager.processEventLoop(EventQueueManager.java:86)
         at com.ibm.wps.pe.pc.std.PortletContainerImpl.performEvents(PortletContainerImpl.java:168)
         at com.ibm.wps.pe.pc.PortletContainerImpl.performEvents(PortletContainerImpl.java:229)
         at com.ibm.wps.engine.phases.WPActionPhase.processPortlets(WPActionPhase.java:947)
         at com.ibm.wps.engine.phases.WPActionPhase.execute(WPActionPhase.java:489)
         at com.ibm.wps.state.phases.AbstractActionPhase.next(AbstractActionPhase.java:130)
         at com.ibm.wps.engine.Servlet.callPortal(Servlet.java:710)
         at com.ibm.wps.engine.Servlet.doGet(Servlet.java:562)
         at com.ibm.wps.engine.Servlet.doPost(Servlet.java:736)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
         at com.ibm.wps.state.filter.StateCleanup.doFilter(StateCleanup.java:86)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
         at com.ibm.wps.mappingurl.impl.URLAnalyzer.doFilter(URLAnalyzer.java:258)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1086)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:201)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:652)
         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:448)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
    Caused by: com.sp.exceptions.ServicePackagesException: My custom error message
         at pagecode.fragments.GSolus.getTariffsByRef(GSolus.java:297)
         at pagecode.fragments.GSolus.handleServicePackageComboValueChange(GSolus.java:214)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
         ... 68 more
    javax.faces.el.EvaluationException: com.sp.exceptions.ServicePackagesException: My custome error message
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
         at javax.faces.component.UIInput.broadcast(UIInput.java:492)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:252)
         at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:346)
         at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at com.ibm.faces.webapp.FacesGenericPortlet.execute(FacesGenericPortlet.java:637)
         at com.ibm.faces.webapp.FacesGenericPortlet.processAction(FacesGenericPortlet.java:142)
         at com.sp.portlet.GoldenAccountPortlet.processAction(GoldenAccountPortlet.java:143)
         at com.ibm.wps.pe.pc.std.cmpf.impl.PortletFilterChainImpl.processAction(PortletFilterChainImpl.java:104)
         at com.ibm.wps.propertybroker.standard.filter.PropertyBrokerActionFilter.processAction(PropertyBrokerActionFilter.java:260)
         at com.ibm.wps.pe.pc.std.cmpf.impl.PortletFilterChainImpl.processAction(PortletFilterChainImpl.java:95)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletServlet.dispatch(PortletServlet.java:148)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletServlet.doPost(PortletServlet.java:76)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at com.ibm.wps.pe.pc.std.cache.CacheablePortlet.service(CacheablePortlet.java:257)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1095)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:254)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:204)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:168)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.action(PortletInvokerImpl.java:82)
         at com.ibm.wps.pe.pc.std.event.ActionEvent.execute(ActionEvent.java:111)
         at com.ibm.wps.pe.pc.std.event.EventQueueManager.processEventLoop(EventQueueManager.java:86)
         at com.ibm.wps.pe.pc.std.PortletContainerImpl.performEvents(PortletContainerImpl.java:168)
         at com.ibm.wps.pe.pc.PortletContainerImpl.performEvents(PortletContainerImpl.java:229)
         at com.ibm.wps.engine.phases.WPActionPhase.processPortlets(WPActionPhase.java:947)
         at com.ibm.wps.engine.phases.WPActionPhase.execute(WPActionPhase.java:489)
         at com.ibm.wps.state.phases.AbstractActionPhase.next(AbstractActionPhase.java:130)
         at com.ibm.wps.engine.Servlet.callPortal(Servlet.java:710)
         at com.ibm.wps.engine.Servlet.doGet(Servlet.java:562)
         at com.ibm.wps.engine.Servlet.doPost(Servlet.java:736)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
         at com.ibm.wps.state.filter.StateCleanup.doFilter(StateCleanup.java:86)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
         at com.ibm.wps.mappingurl.impl.URLAnalyzer.doFilter(URLAnalyzer.java:258)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1086)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:201)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:652)
         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:448)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
    Caused by: com.sp.exceptions.ServicePackagesException: My custome error message
         at pagecode.fragments.GSolus.getTariffsByRef(GSolus.java:297)
         at pagecode.fragments.GSolus.handleServicePackageComboValueChange(GSolus.java:214)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
         ... 68 more

  • Creating a custom JSF Component

    Hi,
    I am trying to create a custom JSF Component. My ultimate goal is to pass a bean to my custom component and have the component render some HTML output based on the info contained in the bean. Before I attempt that I am trying to get a simple custom component to just work. This component is based on the tutorial found here: http://www.jsftutorials.net/components/index.html
    This tutorial just creates a component that outputs a <div> tag around the body contents of the custom component.
    To keep this short I have done the following items from the tutorial link above:
    1) I have created the tld file defining the tag class, name, uri and shortname
    2) I have also created the tag class called TickerTag.java along with the component class UITicker.java. These classes are straight copy-and-paste jobs from the tutorial link and compile fine.
    3)My faces-config.xml file has the proper component definition of
    <component>
    <component-type>ticker</component-type>
    <component-class>ticker.UITicker</component-class>
    </component>
    This was the easy part. The example then goes on to use the custom component in a JSP page. I managed to get the custom component to work in a JSP page BUT my problem is getting the custom component to work in an XHTML file.
    I thought all I had to do was define an xml namespace using the uri from my tld file like so:
    Note: My uri is www.fubar.com/tags and is defined in the tld file.
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:u="http://www.fubar.com/tags">
    I then try to use the tag like so <u:ticker> <f:verbatim>Hello JSF Component</f:verbatim></u:ticker>
    I am expecting the following output: <div>Hello JSF Component
    </div>
    but instead I get
    <u:ticker>Hello JSF Component</u:ticker>
    It seems the tag is not even processed. This is my first jump into custom components. I have done custom JSP tags in the past but I never tried to display them on an XHTML page.
    If you are wondering why I am using XHTML pages, this was setup a while back by a previous developer. Changing everything to a JSP would take a long time and probably break some stuff I am not aware of yet. As such the web.xml file of this JSF web app has the following:
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    So all *.jsf files are processed and sent to the corresponding .xhtml file.
    I have looked up creating custom components on google and every last example uses their newly created components in a jsp file. No XHTML uses so far.
    Below are my tld files and xhtml file if that helps:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>u</short-name>
    <uri>http://www.fubar.com/tags</uri>
    <tag>
    <name>ticker</name>
    <tag-class>ticker.TickerTag</tag-class>
    <body-content>JSP</body-content>
    </tag>
    </taglib>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:u="http://www.fubar.com/tags">
    <html>
    <head>
    <title>Show Custom Component</title>
    </head>
    <body>
    <f:view>
    <u:ticker> <f:verbatim>Hello JSF Component</f:verbatim></u:ticker>
    </f:view>
    </body>
    </html>
    Any suggestions/help are much appreciated,
    Nick
    </div>

    Thanks Ray. I'll take a look at that site.
    I managed to figure out my problem. I never created a .taglib.xml file that reference the component I defined in the faces-config.xml file. Once I did that everything work perfectly.
    I managed to use this forum post as a guide.
    http://osdir.com/ml/java.facelets.user/2006-12/msg00042.html
    I hope this helps anyone else.
    Nick

  • Create a custom JSF component

    Hi,
    I want to create a custom JSF component. I've setup a new application containing 2 projects:
    - a 'components' project, containing all the custom components
    - a 'view' project, to test the created custom components.
    There is dependency between the components project and the view project. In the view project, I added the
    the Tld, in order to use my components in the project.
    From the component palette, I can drop a component onto a .jspx page but after running the page, no output
    is printed onto the screen. The HTML source code only contains my 'tag-name' (eg: <ctb:mytag/>)
    Am I doing something wrong?
    UIComponent:
    import java.io.IOException;
    import javax.faces.component.UIComponentBase;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;
    public class BasicComponent extends UIComponentBase {
        public String getFamily() {
            return "BasicComponent";
        public void encodeBegin(FacesContext context) throws IOException {
            ResponseWriter out = context.getResponseWriter();
            out.write("Hello World");
    }Tag
    import javax.faces.component.UIComponent;
    import javax.faces.webapp.UIComponentTag;
    public class BasicComponentTag extends UIComponentTag {
        public String getComponentType() {
            return "BasicComponent";
        public String getRendererType() {
            return null;
    }Tld entry:
      <tag>
        <name>BasicComponent</name>
        <tag-class>BasicComponentTag</tag-class>
        <body-content>JSP</body-content>
      </tag>Thanks in advance,
    Koen Verhulst

    The body tag should be as follows
    <bodycontent>JSP</bodycontent>
    but the JSP will not work. Here is the file:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    xmlns:cust="http://xmlns.oracle.com/adf/faces/customizable"
    xmlns:cf="/WEB_INF/helloWorldLib.tld">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>List of Values</title>
    </head>
    <body><h:form>
    <cf:jsfhello hellomsg="This is it" />
    </h:form></body>
    </html>
    </f:view>
    </jsp:root>
    Edited by: bongo2 on Oct 28, 2008 2:58 PM

  • How to load a class dynamically (via reflection) in a jsf-component

    Hi all,
    I am writing my own jsf component and I would like to do it generically. Therefore I have an attribute, where the developer can pass a fully qualified classname, which I want to use to instantiate. But I have a Problem with the classloaders, everytime I get a ClassNotFound-Exception during debugging.
    Does anybody know how it is possible, to to get the most parent classloader?
    Currently I am even not able to load a class, which is in the same package like all other compontent-classes.
    Thank you very much in advance
    Thomas

    Within web applications, I believe it is recommended to use Thread.getContextClassLoader(). Keep in mind that web applications require different classloader semantics than regular Java applications. The class loader which gets resources from the WAR is favored over others, even when this violates the normal class loading conventions.

  • How to add properties to a custom JSF component?

    Hello, everybody!
    I've just developed my first custom JSF component. It's a data pager and it is working pretty well. But now I want to be able to use some of it attributes in my backing beans at runtime. I mean, I want to bind it to component in the JSF page. It already has a binding attribute in the tld file, but I want to be able to accesss two values that the renderer of my custom component calculate inside it, which would relieve me from calculating these values manually in the backing beans. So, I would like to know how to make these values external to the component.
    By now this is my custom pager class:
    import javax.faces.component.UICommand;
    public class UIPaginadorDados extends UICommand
    }You can see that it has no logic because all the logic is in the renderer class:
    import javax.faces.render.Renderer;
    public class PaginadorDadosRenderer extends Renderer
        // logic here
    }As I said I want to be able to do the following in my backing beans:
    private UIPaginadorDados pager = new UIPaginadorDados();
    // and later...
    pager.getCurrentPage();
    pager.getPageCount();In the JSF page:
    // I already can do this, because I have a binding attribute
    <urca:paginadorDados binding="#{backingBean.pager}" />I suppose that I'll have to create the properties getCurrentPage() and getPageCount() in the component class, UIPaginadorDados, but I don't know how to get the values to the properties from the renderer class. I don't even know if this is how I should do it.
    So I would appreciate a lot your help about this subject.
    Thank you.
    Marcos

    Marcos_AntonioPS wrote:
    RaymondDeCampo wrote:
    I neglected to mention: do not forget to implement the methods in StateHolder to preserve the properties you added to your component.Hello, Raymond. Could you elaborate a little more on that? If you could give a short example, it would be helpful.
    MarcosNo problem. I have already found out how.
    Thank you very much, Raymond.
    Marcos

  • How can I include a javaScript files from within jsf component

    Is there any way using which I can include javascript files from my jsf component. Because otherwise I have to write all the javascript commands using writer.write which is very tedious rather than this I just want to include the javascript file which contains all the functions required. Also I want that this file should be included only once irrespective of the number of components included.
    Thanx in advance

    This doesn't depend on JSF. You need to include a script tag, like:
    <script src="/path/script.js"
    language="JavaScript" type="text/javascript"></script>
    If you want to include this only once, make a file included into every page, into which you can put other resources to be included along with this script.
    HTH,
    rs.

  • JSP : Tiles Error �tag.getAsString� : component context is not defined

    JSP : Tiles Error �tag.getAsString� : component context is not defined
    I�m working with Struts 1.1 and Tiles, under Tomcat 5.0.16
    My application works fine using Struts 1.1 alone, however, when attempting to run the application in a �Tiles� environment, I get an error:

    javax.servlet.jsp.JspException: Error - tag.getAsString : component context is not defined. Check tag syntax

    I have �defined� this in my �tiles-defs.xml� file, and as far as I can tell, everything else is configured properly (I have looked over the included Struts document examples, and others on the web, and I seem to have everything configured identically).
    What am I missing???
    I have created a series of �mostly� empty JSP files, for simplicity sake.
    JSP FILES:
    -     header.jsp
    -     footer.jsp
    -     menu.jsp
    -     rootLayout.jsp
    -     user.jsp
    -     show_user.jsp
    -     error.jsp
    -     defaultContentPage.jsp
    All JSP files contain:
    <%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles" %>
    and

    <title>
    <tiles:getAsString name="title"/>
    </title>

    My �tiles-defs.xml�: =================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
    <!-- ================ RootLayout ======================= -->
    <definition name=".root.layout" path="/jsp/rootLayout.jsp" >
    <put name="title" value="Default title"/>
    <put name="header" value="/jsp/header.jsp"/>
    <put name="menu" value="/jsp/menu.jsp"/>
    <put name="content" value="/jsp/defaultContentPage.jsp"/>
    <put name="footer" value="/jsp/footer.jsp"/>
    </definition>
    <!-- ================ Extentions ======================= -->
    <!-- User -->
    <definition name=".view.user" extends=".root.layout">
    <put name="title" value="Welcome to the User Form."/>
    <put name="content" value="/jsp/user.jsp"/>
    </definition >
    <!-- Save -->
    <definition name=".view.save" extends=".root.layout">
    <put name="title" value="Welcome to the Show User Form."/>
    <put name="content" value="/jsp/show_user.jsp"/>
    </definition >
    <!-- Error -->
    <definition name=".view.error" extends=".root.layout">
    <put name="title" value="Error Message."/>
    <put name="content" value="/jsp/error.jsp"/>
    </definition >
    </tiles-definitions>
    My �struts-config.xml�: ==============================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <!-- ========== FormBeans =================================== -->
    <form-beans>
    <form-bean name="userForm" type="biz.seamrog.strutstest.model.state.UserForm"/>
    </form-beans>
    <!-- ========== Action Mapping Definitions=================== -->
    <action-mappings>
    <!-- Action using normal forward syntax...
    <action path="/user"
    forward="/jsp/user.jsp">
    </action>
    -->
    <!-- Action using a "Tiles" forward syntax...
    The "forward" path mappings are defined in a file named
    "../WEB-INF/tiles-defs.xml
    -->
    <action path="/user"
    forward=".view.user">
    </action>
    <!-- Action using normal forward syntax...
    <action path="/save"
    type="biz.seamrog.strutstest.model.logic.SaveAction"
    name="userForm" scope="request"
    input="/jsp/user.jsp">
    <forward name="success" path="/jsp/show_user.jsp"/>
    <forward name="failure" path="/jsp/error.jsp"/>
    </action>
    -->
    <!-- Tiles syntax -->
    <action path="/save"
    type="biz.seamrog.strutstest.model.logic.SaveAction"
    name="userForm" scope="request"
    input="/jsp/user.jsp">
    <forward name="success" path=".view.show_user"/>
    <forward name="failure" path=".view.error"/>
    </action>
    </action-mappings>
    <!-- ============== Global Forwards ======================== -->
    <global-forwards>
    <!-- NOTE: paths with "." syntax are Tiles defined paths,
    all other paths follow conventional "/path/to/file.jsp syntax
    -->
    <forward name="user" path=".view.user"/>
    <forward name="show_user" path=".view.show_user"/>
    <forward name="error" path=".view.error"/>
    <forward name="cssBase" path="/stylesheets/common.css"/>
    </global-forwards>
    <!-- ============= Plug-ins =============== -->
    <!-- Tiles Plug-in -->
    <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml"/>
    <set-property property="definitions-parser-validate" value="true" />
    <set-property property="moduleAware" value="true" />
    </plug-in>
    </struts-config>
    My �web.xml�: =====================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
    <web-app>
    <servlet>
    <!--
    MyController extends org.apache.struts.action.ActionServlet
    NOTE: The servlet could also be specified specifying the
    default Struts ActonServlet...
    <servlet-name>controller</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    ...I have chosen to extend here just for practice sake.
    -->
    <!--
    <servlet-name>MyController</servlet-name>
    <servlet-class>biz.seamrog.strutstest.controller.MyController</servlet-class>
    -->
    <servlet-name>MyController</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <!--
    Point to Struts configuration file(s)
    -->
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <!-- Tiles config -->
    <init-param>
    <param-name>definitions-config</param-name>
    <param-value>/WEB-INF/tiles-defs.xml</param-value>
    </init-param>
    <!-- This is the added Application parameter: -->
    <init-param>
    <param-name>application</param-name>
    <param-value>ApplicationResource</param-value>
    </init-param>
    <!-- end -->
    <load-on-startup>5</load-on-startup>
    </servlet>
    <!--
    All incoming requests that end in .do, send to MyController.
    -->
    <servlet-mapping>
    <servlet-name>MyController</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!--
    Send initial requests to the login page for this application
    -->
    <welcome-file-list>
    <welcome-file>/jsp/user.jsp</welcome-file>
    </welcome-file-list>
    <!--
    Make all of the necessary related Struts JSP custom tag libraries
    available and define where to find them.
    -->
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-tiles.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-tiles.tld</taglib-location>
    </taglib>
    </web-app>
    My �rootLayout.jsp�: ================================================
    <%@page contentType="text/html"%>
    <%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles" %>
    <html>
    <header>
    <title>
    <tiles:getAsString name="title" />
    </title>
    <body>
    <tiles:get name="header"/>
    <tiles:get name="menu"/> <tiles:get name="content"/>
    <tiles:get name="footer"/>
    </body>
    </html>

    I found an entry in the Mail Archive for Struts. I got it working. My working code is below. You need to in the base JSP import the header and put the 'title' out to it.
    tiles:def file:
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
    <definition name=".petstore.Base" path="/common/petstorecommon.jsp">
    <put name="title" value ="${title}"/>
    <put name="header" value="/common/header.jsp"/>
    <put name="message" value="/common/message.jsp"/>
    <put name="content" value="${content}"/>
    <put name="navbar" value="/common/navbar.jsp"/>
    </definition>
    <definition name="petstore.Login" extends=".petstore.Base" >
    <put name="title" value="Login Page" />
    <put name="content" value="/Logon.jsp"/>
    <put name="test1" value="test1value"/>
    </definition>
    base tile def:
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html:html>
    <head>
    <html:base/>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>pet store common (jsp)</title>
    </head>
    <body>
    <tiles:insert attribute="header">
    <%-- both of these attributes are accessible from header.jsp It works!!! --%>
    <tiles:put name="title" beanName="title" beanScope="tile" />
    <tiles:put name="test1" beanName="test1" beanScope="tile" />
    </tiles:insert>
    <%-- <tiles:get name="header" /> --%>
    <tiles:get name="message" />
    <tiles:get name="content" />
    <tiles:get name="navbar" />
    </body>
    </html:html>
    Getting access to the title value in the header.jsp file:
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
    <html>
    <head>
    <tiles:getAsString name="title" />
    <tiles:getAsString name="test1" />
    </head>
    <body>
    </body>
    </html>

  • How to make Javascript access standard JSF component

    Hello all,
    I'm in need of a proper javascript code that access standard jsf component.
    Like we do for html tags;
    if( el.tagName.toLowerCase() != 'select')
    I need to do the same thing for a jsf tag i.e; <h:selectOneMenu>. How to make javascript access <h:selectOneMenu> like it does with <select> tag ? Please let me know asap. Extremely sorry if the question is kind of stupid....cause I'm a beginner for JSF environment.
    Any sort of help, suggestion or advice would highly be appreciated.
    Thanks in advance.

    Ummmm, I may be off the beaten path, but by the time your javascript is called the h:selectOneMenu would be a select tag within the dom. You should be able to reference that tag as you normally would.

  • JSF component inside HTML table -- not rendering properly

    I have a HTML table like the one below. In one of those columns (td) I have a JSF component. When I run the app, the JSF component (even if its a simple inputText or panelGrid or panelGroup) is not getting inside the td. Instead, it forms a seperate table after this td.
    Code I have:
    <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td>... ..MULTIPLE Td's here - Deleted for simplicity </td>
    <td class="topNav">
    Blog Directory
    </td>
    <td>
    <img src="./images/top_button_right.gif"/>
    </td>
    <td class="topNav">
    <f:panelGroup>
    <h:inputText value="Username"/>
    <h:inputSecret value="Password"/>
    </f:panelGroup>
    </td>
    </tr>
    </tbody>
    </table>
    What I expected:
    username, passwd field inside the top level HTML table.
    What comes: (as a result of running thsi JSF page )
    <table> -- Original table
    <td> </td> -- -TD that had the inputText - comes empty here
    </table>
    <table>
    <tbody>
    <tr>
    <td><input type="text" name="_id1:header:EasyHeader:_id4" value="Username" /><input type="password" name="_id1:header:EasyHeader:_id5" value="" /></td>
    </tr>
    <tr>
    <td><table>
    I am a newbie to JSF & due to the complexity of the layout & page, I m unable to get rid of the HTML tags totally.
    Thanks in advance.
    Ganesh

    Found the solution to the problem.
    wrapped the entire HTML page till the JSF component ( panelGrid) under <f:verbatim>.
    something like this
    <f:verbatim>
    <table>
    <tr> <td>...</td>
    <td>
    </f:verbatim>
    <h:panelGrid> ... </h:panelGrid>
    <f:verbatim>
    </td>
    </table>
    </f:verbatim>

  • Can I write Design-time for JSP custom tag(not JSF components)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Maybe you are looking for

  • EWS managed API 2: How to move ItemAttachments to a Folder

    I'm trying to write a simple service that will take ItemAttachments and move them to an arbitrary Microsoft.Exchange.WebServices.Data.Folder. Can this be done? I'm using Exchange 2010 SP2. The following code generates a System.InvalidOperationExcepti

  • T410 with Windows XP Professional availability ?

    First it seems you cannot buy an XP downgraded machine directly from Lenovo anymore, even from the business portal (this is for business use). Can anyone confirm this ? Our company hasn't bought from lenovo directly before. We have always bought from

  • ??? Calling oracle stored procedure

    hi All, I have created one user-defined type in Oracle. say for ex:- create type address (no varchar2, place varchar2, city varchar2, state varchar2, nation varchar2); Then i created one procedure, which have this data-type as an argument with in and

  • Permission to run SQL Server DTA - dbo access needed --- to the user database, or msdb ?

    Hi All,        I am remotely working with a developer who wants to run DTA (SQL Server 2008 R2). I gave the AD Group "ALTER TRACE" permission, and also "execute" permission to xp_msver in master db. I also read that the user needs to be in dbo group.

  • RPE-02150 - Deploy  Intelligent Objects

    Hi! I had followed this tutorial, but I use OWB 11g. I derived the end user metadata from my design. then I created a new user:eul_from_owb from Global Explorer->Security->User. When I try to deploy the Intelligent Objects, I get a error: "RPE-02150: