tomahawk inputSuggest[Ajax]
is there any way to restrict values to only those on suggestion list? (versus something user typed in that isn't on suggestion list). kind of like selectOneMenu?
grey out a jscookmenu item?
anyone aware of a way to grey out a jscook menu item dynamically?
easy back button question?
i understand there are some far reaching issues with the back button, with respect to the back button leaving things in a bad state, but i'm not looking for the back button holy grail (just now). my question is simply what would be the best way to get a button on a jsf page which mimics functionality of browser's back button: the equivilent of the ever popular: a href=javascript:history.back()Back/a ? thx...
Re: easy back button question?
thanks martin, yes, i saw this blog post with a more elaborate solution than i was hoping for: http://jroller.com/page/cenkcivici?entry=custom_jsf_navigation_handler_for but since it was posted on friday the 13th, i would never use it cause it's bad luck ;) but seriously, i was hoping for something a bit less involved. i couldn't get the history.back() bit to work with either a commandButton or commandLink, what i currently have is the following: f:verbatim input type=button onclick=javascript:history.back() value=Back / /f:verbatim which has the desired effect, but it has the drawback of not being able to use the messages.properties file and value=#{messages['button_back']} for localization. anyone have any ideas for getting the localized value in there instead of hardcoding Back...? Martin Marinschek wrote: Hmm... Well, if you use client-side state saving ( or server-side state saving and MyFaces after 1.1.1) you can use that trick above. If you want to post-back to the server in between, you can write a custom Navigation-Handler and configure that in your faces-config.xml. This navigation-handler would need to store a stack of pages visited somewhere and then just go back if the outcome equals to some predefined string (e.g. back). I'm sure somebody can jump in with some source to support you, right? regards, Martin On 1/31/06, tony kerz [EMAIL PROTECTED] wrote: i understand there are some far reaching issues with the back button, with respect to the back button leaving things in a bad state, but i'm not looking for the back button holy grail (just now). my question is simply what would be the best way to get a button on a jsf page which mimics functionality of browser's back button: the equivilent of the ever popular: a href=javascript:history.back()Back/a ? thx... -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: jsf analogy to struts action
thanks for the suggestions. - i don't think i need any jsf facilities during processing, so your first suggestion would be most pragmatic. - just in case i end up needing to go the second route though, for this or something else, how does one call the standard navigation handler manually? - just for kicks i tinkered with a javascript hack to call an action method, and this seems to work although it has the drawbacks of: (a) having to specify the button id as named by the jsf implementation (i.e. form name:button name) and i don't think this naming convention is part of the spec and therefore not portable and (b) having the dummy form flash momentarily although you might be able to give the button zero size or something so that it is a completely blank screen %@ include file=/include/taglibs.jsp% body onload=document.getElementById('dummy:submit').click(); f:view h:form id=dummy h:commandButton id=submit action=#{account.complete} / /h:form /f:view /body - as an aside, i originally tried document.dummy.submit() for onload, but it resulted in an infinite loop. i'm sure an artifact of the clever way jsf is implemented, but unexpected just the same. Craig McClanahan wrote: Since you don't care about restoring a JSF component tree on this particular page, it might be simpler to not worry about using JSF at all to process the request: * Create a standalone servlet mapped to the front of the URL on the confirmation email. * It would use standard servlet API facilities to pull the information it needs out of the URL, and do the database lookup/update. * It would navigate by doing a RequestDispatcher.forward() to either /congratulations.faces or /problem.faces. If you did want to use JSF facilities in the processing (say, you wanted to evaluate value bindings or create managed beans), an alternative would be to use a phase listener for the Before Restore View event, intercepting the incoming request before the standard processing lifecycle. Your handler could do the database update, then call the standard navigation handler manually based on the outcome.
Re: jsf analogy to struts action
thanks craig, you bring good points about confusion being proportional to the number of technologies applied. in this particular case, the mechanism i'm trying to construct is a relatively familiar one where a user is confirming a registration to a website by clicking a url link in a registration confirmation email. kind of an oddball when compared to the rest of the application which should be more comfortable with standard jsf. the query string will contain the id of the user attempting to confirm their registration, and i have to look up that id in a database to make sure it exists and mark it as confirmed if so. my original tactic was to perform this logic in a getter method of a message type attribute being displayed on some confirmation page. if i incurred an error, i would just return an error message, otherwise i would return a congratulations message, but i already had a strategy for handling errors from action methods which involved navigating to a dedicated error page based on outcome and it bugged me that i had to use a different mechanism here. ok, now that i've fessed up, you can come to a more informed decision as to whether i'm obsessing ;) Craig McClanahan wrote: On 12/21/05, *tony kerz* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: right, i'm looking for the process to be initiated by a url punched into a browser, not a user clicking a h:commandButton or h:commandLink control. as i can have a url drop directly into an action and use mapping.findForward(outcome) to use the struts configuration navigation rules to direct to the next page. is there an analogy to mapping.findForward() that could be invoked in a controlling servlet? seems like it could be useful to have a servlet which you could pass in something like managedBeanName.actionMethodName in as a parameter and have it do the right thing. You can always use for real Struts navigation, if you like, by using JSF in conjunction with the Struts-Faces integration library. But ... That all being said, I wonder if you might be obsessing over a low level implementation detail, rather than deriving an architecture from application requirements. One of the things I have most enjoyed about using JSF is freedom from ever having to wire URLs together with Java or JavaScript code ... I can just focus on the task at hand. Requirements for bookmarkability complicates that scenario a bit, in that you do need to care what kinds of URLs get emitted. But redirects, in combination with a custom navigation handler, would seem more elegant to me. One thing I would tend to avoid, however, is a plan to mix both JSF-style and Struts-style navigation into the fundamental architecture of my application -- that's just asking for confusion later on in your application's lifetime, when you have to decide (for each new bit of functionality) whether you should do it the JSF way or the Struts way. Target doing things one way or the other -- the only place for having both is when you are transitioning from one technology to the other, and you don't have time to convert the entire application at once. (NOTE - to provide application functionaity on an initial processing of a URL, use Shale's ViewController as mentioned on the corresponding thread in the Struts user mailing list.) Craig
jsf analogy to struts action
at the risk of asking a stupid question: if i wanted to have a user hit a url and have some processing take place which then results in one of several available pages being displayed, in struts i could easily accomplish that with an action class. what would be the appropriate way to accomplish that functionality in a JSF application? something like dropping into an action method on a backing bean, but without the initial page...
obtaining real url after navigation rules
i'm having an issue attempting to apply the spring based acegi security layer to myfaces. basically, acegi seeks to apply a servlet filter to each page navigated to and apply a set of security rules to either grant or deny access to that page. the issue that i'm encountering is that the servlet filter always seems to be one url behind the page that i'm on (and thus the desired security functionality is sadly lacking). i tried reversing the order of the extensions filter and the acegi filter and that had no effect. any insight appreciated. in lieu of a direct solution to this issue, my next strategy may be to attempt to grab the correct url programatically and pass it to over to acegi, so any suggestions on ways to go after that via faces context would also be welcomed. i already tried looking in HttpServletRequest obtained from the external context, and sadly, it was one url behind as well :( thanks, tony.
Re: not connected to internet and http://java.sun.com/dtd/web-facesconfig_1_1.dtd?
my apologies, you're absolutely right simon. at a glance, it looks myfaces related because it is going after faces-config.xml in myfaces.jar, but a closer examination of the stack trace indicates that it's spring and/or spring-jsf related... i'll try around those forums/mailing lists for some insight... org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from URL [jar:file:/C:/Documents%20and%20Settings/Tony/My%20Documents/work/eclipse/conciergeWeb/.deployables/conciergeWeb/WEB-INF/lib/myfaces.jar!/META-INF/faces-config.xml]; nested exception is java.net.UnknownHostException: java.sun.com java.net.UnknownHostException: java.sun.com at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.Socket.connect(Socket.java:507) at java.net.Socket.connect(Socket.java:457) at sun.net.NetworkClient.doConnect(NetworkClient.java:157) at sun.net.www.http.HttpClient.openServer(HttpClient.java:365) at sun.net.www.http.HttpClient.openServer(HttpClient.java:477) at sun.net.www.http.HttpClient.init(HttpClient.java:214) at sun.net.www.http.HttpClient.New(HttpClient.java:287) at sun.net.www.http.HttpClient.New(HttpClient.java:299) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:913) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:973) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:872) at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:282) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1021) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:161) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:126) at de.mindmatters.faces.spring.FacesSpringWebApplicationContext.loadBeanDefinitions(FacesSpringWebApplicationContext.java:370) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134) at de.mindmatters.faces.spring.support.FacesSpringVariableResolver$GetFacesSpringWebApplicationContext.clinit(FacesSpringVariableResolver.java:113) at de.mindmatters.faces.spring.support.FacesSpringVariableResolver.getFacesSpringWebApplicationContext(FacesSpringVariableResolver.java:146) at de.mindmatters.faces.spring.support.FacesSpringVariableResolver.resolveVariable(FacesSpringVariableResolver.java:139) at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:637) at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124) at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:441) at org.apache.jsp.tag.web.layout_tag.doTag(org.apache.jsp.tag.web.layout_tag:143) at org.apache.jsp.home_jsp._jspx_meth_tags_layout_0(org.apache.jsp.home_jsp:100) at org.apache.jsp.home_jsp._jspService(org.apache.jsp.home_jsp:73) Simon Kitching wrote: Craig McClanahan wrote: On 10/3/05, *tony kerz* [EMAIL
not connected to internet and http://java.sun.com/dtd/web-facesconfig_1_1.dtd?
after a few lumps i realized that the following issue: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from URL [jar:file:/C:/Documents%20and%20Settings/Tony/My%20Documents/work/eclipse/conciergeWeb/.deployables/conciergeWeb/WEB-INF/lib/myfaces.jar!/META-INF/faces-config.xml]; nested exception is java.net.UnknownHostException: java.sun.com java.net.UnknownHostException: java.sun.com was due to not having a connection to the internet. in some circumstances, i need to work when disconnected. anyone know any tricks to address this? i have a local copy of the DTD, but i'm not sure where to place it or what to do to make myfaces look locally for it. i think i can always brute force it by removing the DTD from the faces-config.xml in myfaces.jar, but i would prefer a more practical solution. by the way still using 1.0.9 of myfaces... any help appreciated! thanks, tony.
Document root element faces-config, must match DOCTYPE root null
any one ever see this and know how to resolve? thanks! full stack: 2005-07-16 06:45:22,765 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR org.apache.commons.digester.Digester - Parse Error at line 2 column 14: Document is invalid: no grammar found. org.xml.sax.SAXParseException: Document is invalid: no grammar found. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:177) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at org.apache.commons.digester.Digester.parse(Digester.java:1548) at org.apache.myfaces.config.impl.digester.DigesterFacesConfigUnmarshallerImpl.getFacesConfig(DigesterFacesConfigUnmarshallerImpl.java:200) at org.apache.myfaces.config.FacesConfigurator.feedJarConfig(FacesConfigurator.java:386) at org.apache.myfaces.config.FacesConfigurator.feedJarFileConfigurations(FacesConfigurator.java:311) at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:203) at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(StartupServletContextListener.java:105) at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:88) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3669) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2930) at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:403) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1276) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557) at java.lang.Thread.run(Thread.java:595)
Re: myfaces-examples.war yields blank screen...?
also, getting same result with 1.0.7 and 1.0.8...? Tony Kerz wrote: trying to run myfaces-examples.war with tomcat 5.5.4 and jdk 1.5 and just getting blank screen, any suggestions as to what stupid thing i'm doing (now)...? ;)