[JBoss Seam] - Re: How to define default encoding ?
by nevermoreagain
And i tryed to set filter but it's eather do not work.
| import javax.servlet.*;
| import java.io.IOException;
| public class EncodingFilter implements Filter{
| public void destroy(){ }
|
| public void doFilter(ServletRequest req, ServletResponse resp,
| FilterChain chain) throws ServletException, IOException{
| req.setCharacterEncoding("utf-8");
| chain.doFilter(req, resp);
| }
| public void init(FilterConfig config) throws ServletException
| { }
|
web.xml
| <filter>
| <display-name>EncodingFilter</display-name>
| <filter-name>EncodingFilter</filter-name>
| <filter-class>com.myproject.project.EncodingFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>EncodingFilter</filter-name>
| <url-pattern>*.seam</url-pattern>
| </filter-mapping>
|
please, someone help =))
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049582#4049582
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049582
18 years, 10 months
[JBoss Seam] - How to define default encoding ?
by nevermoreagain
Hello =))
I wondering where can i define default page charset and encoding ?
I tryed to set PhaseListener
| public class EncodingPhaseListener implements PhaseListener {
| /**
| *
| */
| private static final long serialVersionUID = - 5249591857614335618L;
| private static final String ENCODING = "UTF-8";
|
| public void afterPhase (final PhaseEvent event) {
| }
|
| public void beforePhase (final PhaseEvent event) {
| try {
| ((ServletRequest) FacesContext.getCurrentInstance ().getExternalContext ().getRequest ()).setCharacterEncoding (ENCODING);
| ((ServletResponse) FacesContext.getCurrentInstance ().getExternalContext ().getResponse ()).setCharacterEncoding (ENCODING);
| } catch (final UnsupportedEncodingException e) {
| e.printStackTrace();
| }
|
| }
|
| public PhaseId getPhaseId () {
| return PhaseId.ANY_PHASE;
| }
|
|
| }
|
faces-config.xml
| <lifecycle>
| <phase-listener>
| com.myproject.project.EncodingPhaseListener
| </phase-listener>
| </lifecycle>
|
but it's not working....
best regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049579#4049579
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049579
18 years, 10 months
[JBoss Seam] - s:selectItems and text to display between the radio buttons
by bytor99999
I have the following in my xhtml page
| <h:form>
| <h:selectOneRadio value="#{operationAction.selectedControl}">
| <s:selectItems value="#{controlActions}" var="control" label="#{control.name}">
| <p></p><rich:spacer width="24px"/>
| <h:outputText value="#{control.description}"></h:outputText>
| <p></p>
| </s:selectItems>
| </h:selectOneRadio>
| <s:button action="#{operationAction.invokeOperation}" value="Execute"/>
| </h:form>
|
|
As you can see in between the opening and closing of the <s:selectItems> tags I want some extra text to display for each radio button, beyond the label. But this doesn't work.
Also, when I select one of the radio buttons and cllick the <s:button> it is not setting my operationAction.selectedControl to the value of the selected radio button.
What can I do to get this functionality to work? Am I in the complete wrong direction. I was going to use a richfaces component, but they don't have a radio button component.
Thanks
Mark
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049578#4049578
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049578
18 years, 10 months
[JBoss Portal] - Re: error changing theme when logged in as admin in 2.6cr2
by rharari
Hi Andreas,
I´ve tried the last trunk and is still not working.
My environment:
- java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
- JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
Below is the HTML (trying to change portal theme):
| ....
| <!-- Content -->
| <h3>Portal theme properties:</h3>
| <p>The settings defined here will be applied to the whole portal including all the pages
| and windows unless they have been assigned with different settings</p>
| <br><div xmlns="http://www.w3.org/1999/xhtml">
| <span id="themepg" class="portlet-section-body">
|
| <form id="themeform" name="themeform" method="post"
| action="/portal/auth/portal/admin/default/AdminPortletWindow?org.apache.myfaces.portlet.MyFacesGenericPortlet.VIEW_ID=%2FWEB-INF%2Fjsf%2FeditPortalTheme.xhtml&action=1"
| enctype="application/x-www-form-urlencoded">
|
| <table>
| <tbody>
| <tr>
| <td class="portlet-form-field-label"><label for="themeform:layout">Layout:</label>
| </td>
| <td><select id="themeform:layout" name="themeform:layout" size="1" class="portlet-form-field">
| <option value="1column">1column</option>
| <option value="3columns">3columns</option>
| <option value="generic" selected="selected">generic</option>
| <option value="phalanx">phalanx</option>
| <option value="nodesk">nodesk</option>
| <option value="">default</option></select>
| </td>
| </tr>
| <tr>
| <td class="portlet-form-field-label"><label for="themeform:theme">Theme:</label>
| </td>
| <td><select id="themeform:theme" name="themeform:theme" size="1" class="portlet-form-field">
| <option value="maple">maple</option>
| <option value="renaissance" selected="selected">renaissance</option>
| <option value="industrial">industrial</option>
| <option value="mission-critical">mission-critical</option>
| <option value="nphalanx">nphalanx</option>
| <option value="">default</option></select>
| </td>
| </tr>
| <tr>
| <td class="portlet-form-field-label"><label for="themeform:renderSet">RenderSet:</label>
| </td>
| <td>
| <select id="themeform:renderSet" name="themeform:renderSet" size="1" class="portlet-form-field">
| <option value="emptyRenderer">emptyRenderer</option>
| <option value="emptyRendererNoAjax">emptyRendererNoAjax</option>
| <option value="divRenderer" selected="selected">divRenderer</option>
| <option value="divRendererNoAjax">divRendererNoAjax</option>
| <option value="">default</option></select>
| </td>
| </tr>
| </tbody>
| </table>
|
| <br>
|
| <input id="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id42jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
| name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id42jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
| value="Update" onclick="clear_themeform_3A_5Fid41jbpns_5F2fadmin_5F2fdefault_5F2fAdminPortletWindowsnpbj();"
| class="portlet-form-button" type="submit">
|
| <input id="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id43jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
| name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id43jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
| value="Cancel" onclick="clear_themeform_3A_5Fid41jbpns_5F2fadmin_5F2fdefault_5F2fAdminPortletWindowsnpbj();"
| class="portlet-form-button" type="submit">
|
| <input name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj_SUBMIT" value="1" type="hidden">
| <input name="jsf_sequence" value="1" type="hidden">
| <input name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_link_hidden_" type="hidden">
| <script type="text/javascript"><!--
| function clear_themeform_3A_5Fid41jbpns_5F2fadmin_5F2fdefault_5F2fAdminPortletWindowsnpbj() {
| var f = document.forms['themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj'];
| f.elements['themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_link_hidden_'].value='';
| f.target='';
| }
| clear_themeform_3A_5Fid41jbpns_5F2fadmin_5F2fdefault_5F2fAdminPortletWindowsnpbj();
| //--></script>
| </form>
| <input name="themeform_SUBMIT" value="1" type="hidden">
| <input name="jsf_sequence" value="1" type="hidden">
| </span>
| .....
|
I think that should be another FORM tag but it does not appear!?
Maybe there is a bug in ui:define with a decorate template? :(
Another suggestion to fix this is changing the 3 xhtml at portal-admin.sar\portal-admin.war\WEB-INF\jsf:
- editPortalTheme.xhtml, editPageTheme.xhtml and editWindowTheme.xhtml
in all of them remove or comment these 2 lines (in bold):
| <h:form>
| <h:commandButton value="Update" action="#{themePropertyAction.execute}" styleClass="portlet-form-button"/>
| <h:commandButton value="Cancel" action="#{portalobjectmgr.selectObject}" styleClass="portlet-form-button">
| <f:param name="id" value="#{node.id}"/>
| </h:commandButton>
| </h:form>
|
After doing this the generated HTML will be:
| ....
| <br>
|
| <input id="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
| name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
| value="Update" onclick="clear_themeform();"
| class="portlet-form-button" type="submit">
|
| <input id="themeform:_id42jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
| name="themeform:_id42jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
| value="Cancel" onclick="clear_themeform();" class="portlet-form-button" type="submit">
| <input name="themeform_SUBMIT" value="1" type="hidden">
| <input name="jsf_sequence" value="1" type="hidden">
| <input value="" name="themeform:_link_hidden_" type="hidden">
| <script type="text/javascript"><!--
| function clear_themeform() {
| var f = document.forms['themeform'];
| f.elements['themeform:_link_hidden_'].value='';
| f.target='';
| }
| clear_themeform();
| //--></script>
| </form>
| </span>
|
Now it seems to be Ok and after clicking in the update button you should see the message:
Theme has been correctly updated on the portal named: default
regards.
R.Harari
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049577#4049577
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049577
18 years, 10 months
[JNDI/Naming/Network] - data source problem in 4.0.3SP1
by dclemmer
I've set up a datasource via a -ds.xml file. When the application starts, that source shows up as being bound correctly to java:FeedConn (I specified FeedConn in the xml file). When the application attempts to connect to that, however, if I search for java:FeedConn (or java:/FeedConn), it fails to find the datasource. What's very odd, however, is that if I search for just FeedConn, I get a javax.naming.CommunicationException (Receive timed out). Does it connect to a different default location when not using the java namespace (presumably one that jboss doesn't provide by default)? And does anyone have any reason why the name doesn't get found when using that namespace? (FWIW, the initial context is created without arguments).
Thanks,
Dave
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049576#4049576
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049576
18 years, 10 months
[JBoss Seam] - Re: s:selectItems problem
by mgrouch
staticData is application scope
I've turned off seam transaction management now as my
StaticData class loads currencies by calling session EJB3 and relies on EJB3
transaction management (CMT)
Now I'm getting null pointer exception
anonymous wrote : [java] java.lang.NullPointerException
| [java] at org.jboss.seam.framework.EntityIdentifier.(EntityIdentifier.java:15)
| [java] at org.jboss.seam.ui.EntityConverterStore.put(EntityConverterStore.java:61)
| [java] at org.jboss.seam.ui.EntityConverter.getAsString(EntityConverter.java:68)
| [java] at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:469)
| [java] at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:502)
| [java] at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:757)
| [java] at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:811)
| [java] at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
| [java] at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
| [java] at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
| [java] at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
| [java] at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:347)
| [java] at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:342)
| [java] at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
| [java] at org.richfaces.renderkit.html.SimpleTogglePanelRenderer.encodeChildren(SimpleTogglePanelRenderer.java:181)
| [java] at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
| [java] at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| [java] at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| [java] at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
| [java] at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| [java] at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| [java] at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
| [java] at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| [java] at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:232)
| [java] at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| [java] at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| [java] at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| [java] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| [java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| [java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| [java] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| [java] at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:64)
| [java] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
| [java] at org.jboss.seam.web.HttpAuthFilter.processBasicAuth(HttpAuthFilter.java:121)
| [java] at org.jboss.seam.web.HttpAuthFilter.doFilter(HttpAuthFilter.java:79)
| [java] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
| [java] at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:59)
| [java] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
| [java] at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:81)
| [java] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
| [java] at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:47)
| [java] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
| [java] at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:264)
| [java] at org.jboss.seam.web.AbstractAjax4jsfFilter.doFilter(AbstractAjax4jsfFilter.java:35)
| [java] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
| [java] at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:126)
| [java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| [java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| [java] at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:126)
| [java] at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:248)
| [java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| [java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| [java] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| [java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| [java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| [java] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| [java] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| [java] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| [java] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| [java] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| [java] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| [java] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| [java] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| [java] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| [java] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| [java] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| [java] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| [java] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| [java] at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049575#4049575
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049575
18 years, 10 months