Search Results

Search found 3678 results on 148 pages for 'jsf jsp el'.

Page 8/148 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • JSF 2 equivalent of tomahawk subform

    - by digitaljoel
    I have an existing JSF 1.2 app that was a portlet running on glassfish v2. I'm converting it to a webapp running on glassfish v3. The app uses tomahawk subforms in several areas. Tomahawk has not been update for JSF 2, which is what ships with glassfish v3. We would like to update our app to JSF 2. Is there a JSF 2 equivalent to tomahawk's subform? I know one option would be to change all of the subforms to be ajax enabled and use the execute attribute to specify which controls take part in the form submission, but would like to make this as straight across as I can without modifying existing functionality if I can. So, lacking a tomahawk subform substitute, is there any way to specify partial form submission for non ajax events?

    Read the article

  • Quick way to create JSF custom component

    - by michael lucas
    I know of two ways of creating custom JSF components: 1. Native JSF way: creating JSF component class, tag, etc. 2. Facelets way: defining component in a xhtml file and then creating appropriate decrption in facelets taglib. Currently I work on a project in which introducing facelets is unfortunately out of the question. On the other hand, creating custom components the standard JSF way seems like a pain in the ass. Is there maybe a third party library that allows creating custom components in the way similar to facelets but doesn't entail the need of using non-standard renderer?

    Read the article

  • Navigate to the Same Page After Action in JSF 2

    - by shipmaster
    I have a component done in JSF 1.x, this component has a command button as follows <h:commandButton ... action="#{templateController.next}" /> Where templateController was passed as an EL binding and can be any object that implements a certain interface. The generic implementation of next() was just executing code and then returning an empty string causing the same page to refresh: public String next() { ..... return ""; } Now I am trying to port that component to JSF 2, my problem is that an empty string doesn't cause the same page to refresh anymore, instead, the framework tries to redirect to a page called ".jsf" i.e it just appends .jsf to whatever the outcome is. My question is how to return an outcome that causes the current page to refresh. My component is generic and I don't know before hand the name of the page it is going to be used on. Thanks

    Read the article

  • JSF Composite Component

    - by purecharger
    I'm trying to create a composite component for use in my Seam application, and I'm running into problems with the simplest "hello, world" component. I have placed a file named hello.xhtml in {jboss deploy}/application.ear/application.war/resources/greet : <!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:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite"> <head> <title>My First Composite Component</title> </head> <body> <composite:interface> <composite:attribute name="who"/> </composite:interface> <composite:implementation> <h:outputText value="Hello, #{cc.attrs.who}!"/> </composite:implementation> </body> </html> Now in home.xhtml, located at the root of my webapp ({jboss deploy}/application.ear/application.war/home.xhtml): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition 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:g="http://java.sun.com/jsf/composite/greet" xmlns:s="http://jboss.com/products/seam/taglib" template="layout/template.xhtml"> <ui:define name="content"> <div id="content"> <g:hello who="World"/> <br/> </div> </ui:define> </ui:composition> But my "hello, world" is not displayed, and I dont get any error messages, even when I turn on debug level logging for com.sun and javax.faces categories. Any ideas?

    Read the article

  • Calling web services from your JSF code

    - by Abel Morelos
    Let's say that you have a presentation tier in JSF, and that your business tier is accessed using web services. How would you call your web services from JSF? I was considering to have my backing beans to call the web services, but I just though I could use Ajax with JSF in order to connect to the web services. What would you choose and why? Any other choice you could recommend? Thanks.

    Read the article

  • run jsf application with myeclipse and jboss server

    - by chetan
    I develop simple jsf login application,that use icefaces component but, when I tries to run it in jboss server I got following error. Can't find TLD for location [http://java.sun.com/jsf/core]. JAR containing the TLD may not be in the classpath Can't find TLD for location [http://java.sun.com/jsf/html]. JAR containing the TLD may not be in the classpath

    Read the article

  • Between a jsf page and a managed bean, why the getter method is called twice

    - by Bariscan
    Hi, I have a jsf page with a form has an outputtext in it. The value of outputtext component is called from a backing bean (or managed bean). I know when I code it as #{MyBean.myString} Jsf rename it and calls getMyString() method. However the wierd thing is, when I put a breakpoint to the getter method of this component, I see it is called twice during the page is being rendered. The outputtext is in a h:form, and it is the only component wich is bind to a backingbean. I mean, it is so wierd that jsf should get the value when it first come to the getter method, however it needs to go to the getter method twice. Can you explain what is the reason of this behaviour in jsf? Any help would be appreciated, Best wishes, Baris

    Read the article

  • How to access Map in JSF

    - by Muneeswaran Balasubramanian
    Hi to all, I have try to access the map in jsf using C:foreach.But i can't access that in jsf by using"#" symbol.But i can access it using "$" symbol.But i need to access to displayed using jsf component h:outputtext.My sample code is h:form binding="#{MapInJsf.initForm}"> <c:forEach items="#{MapInJsf.nameMap}" var="nameMap"> <%--<li>${nameMap.key}</li>--%> I cann access it <%--<h:outputText value="#{nameMap}"/>--%> <h:outputText value="Name2 : #{nameMap.key}"/> <h:outputText value="Last Name1 : #{nameMap.value}"/> </c:forEach> </h:form> what i do wrong and how can i access that?My Ref link is Dynamic value binding of JSF component Please help me.

    Read the article

  • Integrating JSF with Spring

    - by Abel Morelos
    I haven't implemented any code, I'm still working the overall architecture for a new application and this going to be the first time I use JSF+Spring. I need to put web services in front of the Spring service beans (business logic tier) since these beans could be accessed by other applications besides the presentation tier. While defining the different layers or tiers for the application, I feel unsure about how to integrate JSF (the presentation tier) with Spring (the business tier in this application). I'm considering to define some sort of common tier or service tier in order to provide the glue code for JSF and Spring, but before that I want to hear from others what have they done or if they have used other frameworks to help with the glue code for this scenario (I already checked Spring MVC/Spring Faces, but I'm not sure if that's what I need since I'm thinking of this application more like JSF-centric than Spring-centric, but maybe you could help me about considering another approach). Thanks in advance.

    Read the article

  • JSF Templating without RAD

    - by Jeffrey Knight
    I have a set of jsp's based off a jtpl template. The template (jtpl file) looks like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%-- tpl:metadata --%> <%-- jsf:codeBehind language="java" location="/JavaSource/pagecode/my.java" --%> <%-- /jsf:codeBehind --%> <%-- /tpl:metadata --%> <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%> <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <HTML> <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <f:view> <HEAD> ... Without using RAD, how can I change the jtpl (template) and regenerate jsp? I'm looking for a command line solution. Related question: is the jsp intended to be rendered from the template design-time in the IDE, or runtime on the server?

    Read the article

  • Bookmarkable URL in JSF application - Trying to use Spring Webflow and JSF . Any suggestions ?

    - by vsingh
    Our application is JSF , hibernate & Spring. Currently the url is in following format http://www.skill-guru.com/skill/login/testDetails.faces?testId=62&testName=PMP-Certification-practice-test We want a clean url like http://www.skill-guru.com/urltitle?some parameter One of the ways we could do this is through integration with Spring webflow with JSF. Any other suggestions ? We are trying Spring webflow 1.0 with JSF 2.0 but that does not seem to work.

    Read the article

  • Adding user role constraint redirects Browser to jsf.js script?

    - by simgineer
    My JSF form login was working with Constraint 1 however when I added Constraint 2 to my web.xml doing a submit on the form now takes me to a jsf javascript page. Can someone tell me what I am doing wrong? I would like only administrators to be able to access the /admin/* pages and only registered users to access the entire site included admin files. BTW after I see the java script page I can still navigate to the intended page in the browser, I just don't want the user to see the intermediate js page or need to know the target page URL. Constraint 1 <security-constraint> <display-name>Admin</display-name> <web-resource-collection> <url-pattern>/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>ADMIN</role-name> </auth-constraint> </security-constraint> Constraint 2 <security-constraint> <display-name>Users</display-name> <web-resource-collection> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>USER</role-name> </auth-constraint> </security-constraint> Here is the undesired url I am being redirected to: javax.faces.resource/jsf.js.xhtml?ln=javax.faces&stage=Development Here is the start of the jsf.js.xhtml... /** @project JSF JavaScript Library @version 2.0 @description This is the standard implementation of the JSF JavaScript Library. */ /** * Register with OpenAjax */ if (typeof OpenAjax !== "undefined" && typeof OpenAjax.hub.registerLibrary !== "undefined") { OpenAjax.hub.registerLibrary("jsf", "www.sun.com", "2.0", null); } // Detect if this is already loaded, and if loaded, if it's a higher version if (!((jsf && jsf.specversion && jsf.specversion >= 20000 ) && (jsf.implversion && jsf.implversion >= 3))) { ... Notes I'm using Firefox 10.0.4, Glassfish 3.1 w JSF2.0 lib, j_security_check, and my login realm setup is similar to this

    Read the article

  • JSF (and friends) tags vs. traditional html tags

    - by H3wh0s33ks
    So this question came up today and I didn't have a specific or scientific answer. What are the costs associated with using jsf (or tomahawk, faclets, etc., etc.) tags in place of traditional html tags. My gut reaction is that you should use jsf tags in situations where you need the additional functionality they provide, and use traditional tags when you don't. Also I feel like jsf tags would require more resources (since the server has to take them and rerender them as html anyways) than html. Does anybody know what the cost actually is (as far as time and memory)? Also useful information is what is the convention that is in use, pure jsf or a mixture of the two?

    Read the article

  • MyFaces Test Framework not working with JSF 2.1

    - by Karl Kildén
    we have a lot of tests that uses Myfaces Test Framework for JSF 2.0. http://myfaces.apache.org/test/index.html Problem is we can't get it to work with JSF 2.1. Does anyone know a workaround or a way to solve this? When we run the tests we get the following error: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory It works fine with jsf 2.0 though. A typical use case in our code: // code block; assertFalse("Error message not expected. ", facesContext .getMessages().hasNext()); JSF 2.1 has a few syntax changes so my guess would be that's the problem.

    Read the article

  • Can't seem to redirect from a ViewScoped constructor.

    - by Andrew
    I'm having trouble redirecting from a view scoped bean in the case that we don't have the required info for the page in question. The log entry in the @PostContruct is visible in the log right before a NPE relating to the view trying to render itself instead of following my redirect. Why is it ignoring the redirect? Here's my code: @ManagedBean public class WelcomeView { private String sParam; private String aParam; public WelcomeView() { super(); sParam = getURL_Param("surveyName"); aParam = getURL_Param("accountName"); project = fetchProject(sParam, aParam); } @PostConstruct public void redirectWithoutProject() { if (null == project) { try { logger.warn("NO project [" + sParam + "] for account [" + aParam + "]"); FacesContext fc = FacesContext.getCurrentInstance(); fc.getExternalContext().redirect("/errors/noSurvey.jsf"); return; } catch (Exception e) { e.printStackTrace(); } } } .... public boolean getAuthenticated() { if (project.getPasswordProtected()) { return enteredPassword.equals(project.getLoginPassword()); } else return true; } } Here's the stack trace: SEVERE: Error Rendering View[/participant/welcome.xhtml] javax.el.ELException: /templates/participant/welcome.xhtml @80,70 rendered="#{welcomeView.authenticated}": Error reading 'authenticated' on type com.MYCODE.general.controllers.participant.WelcomeView at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:107) at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190) at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:416) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1607) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616) at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.MYCODE.general.filters.StatsFilter.doFilter(StatsFilter.java:28) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:421) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:637) Caused by: java.lang.NullPointerException at com.MYCODE.general.controllers.participant.WelcomeView$$M$863c205f.getAuthenticated(WelcomeView.java:127) at com.MYCODE.general.controllers.participant.WelcomeView$$A$863c205f.getAuthenticated(<generated>) at com.MYCODE.general.controllers.participant.WelcomeView.getAuthenticated(WelcomeView.java:125) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.el.BeanELResolver.getValue(BeanELResolver.java:62) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at org.apache.el.parser.AstValue.getValue(AstValue.java:118) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:102) ... 33 more

    Read the article

  • Call HashMap from jsp EL ?

    - by Parhs
    Here is my Entity Class public enum UnitType { HOSPITAL, HEALTHCENTER } public static LinkedHashMap<UnitType, String> unitType = new LinkedHashMap<UnitType, String>() { { put(UnitType.HEALTHCENTER, "???t?? ??e?a?"); put(UnitType.HOSPITAL, "??s???µe??"); } }; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String address; @Column(columnDefinition = "TEXT") private String info; @Enumerated(EnumType.STRING) private UnitType type; At my jsp <c:forEach var="unit" items="${requestScope.units}"> <tr> <td>${unit.id}</td> <td>${unit.name}</td> <td>${unit.address}</td> <td>??!?</td> <td><a href="#">?e??ss?te?a</a></td> </tr> </c:forEach> How can i place the text value of the enum at ??!? .. Any idea? Tried some ways but nothing worked..

    Read the article

  • ???????????! Java EE 6???????????????/???????!!????UFJ????????????????????????Java EE 6??????JavaOne Tokyo 2012?????|WebLogic Channel|??????

    - by ???02
    ??UFJ?????????????????????????IT??????? ?????????UFJ?????????/????????2007?7????????????JavaEE5?????????Java EE??????????????????????2012?4???????JavaOne Tokyo 2012??????????Java EE 6?????????????????????????Java EE 6???????????????????????????????????????????Java EE 6???????"??????????????"???????????????????????????????????(???)Java EE 6?????????·?????????????????UFJ??????????????? IT??????? ???????? ???????????????????Java EE????????????????????J2EE 1.4??????????????????????????????(EoD:Ease of Development)?????????????????????2006??????Java EE 5?????????·??????????????????????EoD????????????????Java EE 5????????????????????????????Java Servlet?JavaServer Faces(JSF)?????????????API?EoD????????????Dependency Injection(DI???????)?Aspect Oriented Programming(AOP???????????????)???????????????RESTful Web?????API???????????????? ????????????????2009?12?????????????Java EE 6??????Java EE 6???????????????·??????????????????????????????????????????????????·??????????????????????????????????????????????????????Java EE 6????????????????????????Java EE??????Java EE 6???????????? Java EE 6????1?????????????????????????????????????Java EE 6???JSF??????1.2??2.0??????????????JSF 1.2?????????????????????????????????????????????????????????????????????????????????JSF 2.0??????????????????????????????????(???)????????Ajax??????????????????????????????????????????????????????JSF????????????????UI?????????????????(?????)?????HTML???JSF???????????HTML?JSF????????????(?)???????????????JSF 2.0???????????? ???EJB??????3.0??3.1??????????EJB 3.1???????EoD???????????????????????????????????????Singleton??????????Session Bean????????????Java Persistence API(JPA)??????1.0??2.0????????????????????(?????)?????????????? ???????Java EE 6???????API???/???????????????Java EE 6?????"?????"???????Contexts and Dependency Injection(CDI) 1.0?????????JSF?EJB?JPA???????????DI?????????????????????Java EE 5???DI????????Java EE?????????????????????????????CDI??????????JavaBeans????DI???????????????????CDI??????????????????·?????????????1???????????????(???????)?????????????????????????????????·??????? ??????????API?????1??????????Java API for RESTful Web Services(JAX-RS) 1.1?????????????????Java?RESTful Web????????????API?????????2???????1???SOAP????Web??????????????????????????????????????????????????1???Web??????????JavaScript????·???·???????????????????JAX-RS??? ????????????????????Java EE 6?????????????????????????EoD???????:???????JSF?????????????????????????:?????????API?????????????????????????????????????API?Java EE????????????????????????????????EJB?????EAR???????????WAR??????????????????????????????:JNDI????????????(?????)????????????Java EE 6??????????????????????! ?????????????·???????????????????????????Java EE 6??????????Java EE 5????????????????????????????????????????????Web?????????????????????Model/View/Controller(MVC)???????????????????????????(1)HTML?JSF???????????(JSF 2.0???)(2)????UI????????????????(JSF 2.0???)(3)JavaScript+JAX-RS?????????MVC????(1)HTML?JSF???????????(JSF 2.0???)(2)????UI????????????????(JSF 2.0???)(3)JavaScript+JAX-RS????? ??????(3)JavaScript+JAX-RS???????????????????????????????????·??????????·???????????????????????????????????????????????????????????(???)?????? ???????????3?????(3????)??????????????????3?????????????????????????????????????????????????????????????????????????????/????????????????????????????????????????????????????????·??????????????????????????????????????? ??????????????3??????????????????????????????????????????????????????????????????????????????????????????Java EE 6???CDI????????????·???(JSF?EJB?JPA)??????????????????????EJB??????WAR?????????????????????????????????????????????????????????????????????????????????????????????????? Java EE 6?????????????? ???????????????????????????????(?????·???????)???????Java EE 6???????????????????????????????????????????????·?????????????????????????Java EE 6???????????????????????API????????????????????????????????????·????????Java EE 6??????? ????Java EE 6????????????????????????????????Java EE 6???????????????????????Java EE 6??????????????????????????????????????????????Java EE 6???????????????????????????

    Read the article

  • Writing a Servlet that checks to see if JSP's exist and forwards to another JSP if they aren't

    - by Omar Kooheji
    I've beeb tasked with writing a servlet that intercepts a call to and JSP in a specific directoy, check that the file exists and if it does just forwarding to that file, if if doesn't I'm to forward to a default JSP. I've setup the web.xml as follows: <servlet> <description>This is the description of my J2EE component</description> <display-name>This is the display name of my J2EE component</display-name> <servlet-name>CustomJSPListener</servlet-name> <servlet-class> ... CustomJSPListener</servlet-class> <load-on-startup>1</load-on-startup> </servlet> ... <servlet-mapping> <servlet-name>CustomJSPListener</servlet-name> <url-pattern>/custom/*</url-pattern> </servlet-mapping> And the doGet method of the servlet is as follows: public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { logger.debug(String.format("Intercepted a request for an item in the custom directory [%s]",request.getRequestURL().toString())); String requestUri = request.getRequestURI(); // Check that the file name contains a text string if (requestUri.toLowerCase(Locale.UK).contains("someText")){ logger.debug(String.format("We are interested in this file [%s]",requestUri)); File file = new File(requestUri); boolean fileExists = file.exists(); logger.debug(String.format("Checking to see if file [%s] exists [%s].",requestUri,fileExists)); // if the file exists just forward it to the file if (fileExists){ getServletConfig().getServletContext().getRequestDispatcher( requestUri).forward(request,response); } else { // Otherwise redirect to default.jsp getServletConfig().getServletContext().getRequestDispatcher( "/custom/default.jsp").forward(request,response); } } else { // We aren't responsible for checking this file exists just pass it on to the requeseted jsp getServletConfig().getServletContext().getRequestDispatcher( requestUri).forward(request,response); } } This seems to result in an error 500 from tomcat, I think this is because the servlet is redirecting to the same folder which is then being intercepted again by the servlet, resulting in an infinite loop. Is there a better way to do this? I'm lead to believe that I could use filters to do this, but I don't know very much about them.

    Read the article

  • JSF - managed bean in variable?

    - by Yurish
    Hi! Weird question, but i need to find an answer. Is there any way, in which i can manage managed beans in JSP? I`ll try to explain, what i want to do: Imagine, i have JSP page, which, for example, is called document.save.jsp. I have some various documents with different types. Each of them have their own bean. For example: BillDocument.java, OrderDocument.java and ReportDocument.java. BillDocument.java in my jsp is #{billdoc}. OrderDocument.java - #{orddoc}. ReportDocument.java - #{repdoc}. Each of them have method save(). In my JSP i want to call this method, but i need to know, which document it is. In my mind this structure is something like: <% String currentBean = ""; if(document == BillDocument){ currentBean = #{billdoc}; } if(document == OrderDocument){ currentBean = #{orddoc}; } if(document = ReportDocument){ currentBean = #{repdoc}; } %> Then, my Button with save method on it, may be smth like: <h:commandButton action="currentbean.save"/> Is there any way, in which i can store data about bean, which will be used in this button? Thank`s for your replies!

    Read the article

  • How to get value from Java object

    - by JSF User
    I have this Java object private List<NewAccountObj> dataList; public class NewAccountObj { private int userid; public NewAccountObj(int userid) { this.userid = userid; } public int getUserid() { return userid; } public void setUserid(int userid) { this.userid = userid; } public List<NewAccountObj> getdataList() { return dataList; } What is the proper way to access a value from the object? Is this correct? <h:inputText id="userid" value="#{NewAccountController.dataList.userid}" validator="#{ValidatorAccountController.validateUserID}" autocomplete="off"> <f:ajax event="blur" render="useridvalidator" /> </h:inputText> Is there any other solution?

    Read the article

  • Access variables between nested JSP tags

    - by user308053
    I would like to exchange information between two nested JSP tagx artifacts. To give an example: list.jspx <myNs:table data="${myTableData}"> <myNs:column property="firstName" label="First Name"/> <myNs:column property="lastName" label="Last Name"/> </myNs:table> Now, the table.tagx is supposed to display the data columns as defined in the nested column tags. The question is how do I get access to the values of the property and label attributes of the nested column tags from the table tag. I tried jsp:directive.variable but that seems only to work to exchange information between a jsp and a tag, but not between nested tags. Note, I would like to avoid using java backing objects for both the table and the column tags at all. I would also like to know how I can access an attribute defined by a parent tag (in this example I would like to access the contents of the data attribute in table.tagx from column.tagx). So it boils down to how can I access variables between nested JSP tags which are purely implemented through the tag definitions themselves (no Java TagHandler implementation desired)?

    Read the article

  • Populating JavaScript Array from JSP List

    - by tkeE2036
    Ok so perhaps someone can help me with a problem I'm trying to solve. Essentially I have a JSP page which gets a list of Country objects (from the method referenceData() from a Spring Portlet SimpleFormController, not entirely relevant but just mentioning in case it is). Each Country object has a Set of province objects and each province and country have a name field: public class Country { private String name; private Set<Province> provinces; //Getters and setters } public class Province { private String name; //Getters and setters } Now I have two drop down menus in my JSP for countries and provinces and I want to filter the provinces by country. I've been following this tutorial/guide to make a chain select in JavaScript. Now I need a dynamic way to create the JavaScript array from my content. And before anyone mentions AJAX this is out of the question since our project uses portlets and we'd like to stay away from using frameworks like DWR or creating a servlet. Here is the JavaScript/JSP I have so far but it is not populating the Array with anything: var countries = new Array(); <c:forEach items="${countryList}" var="country" varStatus="status"> countries[status.index] = new Array(); countries[status.index]['country'] = ${country.name}; countries[status.index]['provinces'] = [ <c:forEach items="${country.provinces}" var="province" varStatus="provinceStatus"> '${province.name}' <c:if test="${!provinceStatus.last}"> , </c:if> </c:forEach> ]; </c:forEach> Does anyone know how to create an JavaScript array in JSP in the case above or what the 'best-practice' would be considered in this case? Thanks in advance!

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >