Search Results

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

Page 35/148 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • Open Source Survey: Oracle Products on Top

    - by trond-arne.undheim
    Oracle continues to work with the open source community to bring the most innovative and productive software to market (more). Oracle products received the most votes in several key categories of the 2010 Linux Journal Reader's Choice Awards. With over 12,000 technologists reporting, these product earned top spots: Best Office Suite: OpenOffice.org Best Single Office Program: OpenOffice.org Writer Best Database: MySQL Best Virtualization Solution: VirtualBox "As the leading open source technology and service provider, Oracle continues to work with the community stakeholders to rapidly innovate many open source products for use in fully tested production environments," says Edward Screven, Oracle's chief corporate architect. "Supporting open source is important to Oracle and our customers, and we continue to invest in it." According to a recent report by the Linux Foundation, Oracle is one of the top ten contributors to the Linux Kernel. Oracle also contributes millions of lines of code to these important projects: OpenJDK: 7,002,579 Eclipse: 1,800,000 (#3 in active committers) MySQL: 5,073,113 NetBeans: 7,870,446 JSF: 701,980 Apache MyFaces Trinidad: 1,316,840 Hudson: 1,209,779 OpenOffice.org: 7,500,000

    Read the article

  • Working with Backing Beans in JDeveloper - The Right Way

    - by shay.shmeltzer
    One nice feature that was in JDeveloper for a long time is the ability to automatically expose every component on your JSF page in a backing bean. While this is a nice "work saving" feature, you shouldn't be using this one in most cases. The reason is that it will create objects in your backing bean code for a lot of items you don't actually need to manipulate, making your code bigger and more complex to maintain. The right way of working is to expose only components you need in your backing bean - and JDeveloper makes this just as easy through the binding property in the property inspector and the edit option it has. Here is a quick video showing you how to do that:

    Read the article

  • Spring 3 - Theme with separate JSP

    - by Max
    Hi, I'm trying to rewrite some Spring 1.2 code to Spring 3.0 one. Currently I'm stuck with JSP resolved by URL problem. Application uses separate JSP files with different layouts for serving the same model from the same controller. The JSP is switched using interceptor, that intercepts the url and changes the view. For example: /design_one/mypage.htm -> MyPageController -> /design_one/mypage.jsp /design_two/mypage.htm -> MyPageController -> /design_two/mypage.jsp Is there a way to make same or similar functionality using something better than raw interceptors?

    Read the article

  • Creando un File Upload

    - by jaullo
    Para iniciar hablaremos un poco sobre el control File Upload, de esta forma daremos una idea general de que es y como trabaja. El File Upload es un control de asp.net que permite que los usuarios seleccionen un archivo de cualquier ubicación en el equipo y lo suban a un directorio predeterminado a traves de una página asp.net. En principio este control esta limitado para no permitir subir archivos de mas de 4 MB. Sin embargo, desde el webconfig de nuestra aplicacón podremos cambiar ese valor, ya sea para aumentarlo o bien para disminuirlo. Nuestro ejemplo, se enfocará en crear un webcontrol que permita seleccionar un archivo y guardarlo, asi que empecemos. Lo primero será agregar a nuestra página un webcontrol que llamaremos Upload.ascx Posteriormente en nuestro webcontrol, agregamos el siguiente código: <table style="width: 100%">         <tr>             <td colspan="3">             <div align="center">                  <asp:Label ID="Label1" runat="server" Text="File Upload"></asp:Label>              </div>             </td>                    </tr>         <tr>             <td style="width: 456px" rowspan="2">                                                             &nbsp;</td>             <td style="width: 386px">                                <div align="center">                         <asp:FileUpload ID="FileUpload1" runat="server" Height="24px" Width="243px" />                         <span id="Span1" runat="server" />                            </div>                      </td>             <td rowspan="2">                                                             </td>         </tr>         <tr>             <td style="width: 386px">                 <div align="center">                      <asp:ImageButton Id="btnupload" runat="server" OnClick="btnupload_Click"                     ImageUrl="~/Styles/img/upload.png" style="text-align: center" />           </div>                  </td>         </tr>         <tr>             <td colspan="3">                 &nbsp;</td>         </tr>     </table>  De esta forma nuestro control deberá verse algo así   Por último en el code behin de nuestro control agregamos el código a nuestro boton, el cual será el encargado de leer el archivo que se encuentra en el File Upload y guardarlo en la ruta especificada.  Protected Sub btnupload_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnupload.Click         If FileUpload1.HasFile Then             Dim fileExt As String             fileExt = System.IO.Path.GetExtension(FileUpload1.FileName)             If (fileExt = ".exe") Then                 Label1.Text = "You can´t upload .exe file!"             Else                 Try                     FileUpload1.SaveAs(decrpath & _                        FileUpload1.FileName)                     Label1.Text = "File name: " & _                       FileUpload1.PostedFile.FileName & "<br>" & _                       "File Size: " & _                       FileUpload1.PostedFile.ContentLength & " kb<br>" & _                       "Content type: " & _                       FileUpload1.PostedFile.ContentType                 Catch ex As Exception                     Label1.Text = "ERROR: " & ex.Message.ToString()                 End Try             End If         Else             Label1.Text = "You have not specified a file!"         End If            End Sub   Como vemos en el código anterior tambien hemos agregado otros elementos los cuales nos dirán el nombre del archivo, el tipo de contenido y el tamaño en kb una vez que el archivo ha sido súbido al servidor. Por último deben tomar en cuenta que decrpath es la ruta en donde será subido el archivo, la cual deben variar a su gusto.

    Read the article

  • Why is this simple file upload not working? JSF

    - by Nitesh Panchal
    Hello, Why is this code not working? I always get size() = 0, whenever i upload file. xhtml file :- <?xml version='1.0' encoding='UTF-8' ?> <!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"> <h:head> <title>Abc</title> </h:head> <h:body> <center> <form method="post" enctype="multipart/form-data" id="form" action="/upload/uploadFile"> <input type="file"/> <br/> <input type="Submit" value="upload"/> </form> </center> </h:body> </html> This is my servlet :- package servlets; import java.io.IOException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; @WebServlet(name="uploadFile", urlPatterns={"/uploadFile"}) public class uploadFile extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, FileUploadException { System.out.println("executed!"); List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request); System.out.println(items.size()); for (FileItem item : items) { if (!item.isFormField()) { System.out.println("Name: " + item.getName()); System.out.println("Size: " + item.getSize()); System.out.println("Type: " + item.getContentType()); } } } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (FileUploadException ex) { ex.printStackTrace(); } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (FileUploadException ex) { ex.printStackTrace(); } } @Override public String getServletInfo() { return "Short description"; } }

    Read the article

  • How can I access a JavaScript variable value in JSP?

    - by Pramod
    function modification() { alert(document.getElementById("record").value); var rec=document.getElementById("record").value; <% Connection connect = DriverManager.getConnection("jdbc:odbc:DSN","scott","tiger"); Statement stm=connect.createStatement(); String record=""; // I want value of "rec" here. ResultSet rstmt=stm.executeQuery("select * from "+record); %> }

    Read the article

  • PHP vs JSP Which is should I use/learn for my project?

    - by Jon
    I'm planning on making a fitness planning web application for my senior project at school. However, I don't know anything about either technology and my only experience with web development previously was with python and django. I was wondering what people might recommend to learn, what is most useful to learn for the job market, and what would be best for this project. If it matters, the programming languages I know are, C, C++, Java, and Python. My goal of the project is to learn technologies that will make me a more marketable person. Thanks

    Read the article

  • Does generation of debug information to JSP classes add much to javac execution time?

    - by Rich
    Hi I am looking looking into the options for tweaking the performance of JBoss 5.1.0 and one of the options available to me is to disable the generation of debug information when compiling JSPs. I know that the presence/absence of debug information for the JVM makes no real difference, but does the generation of that debug information add much to compile time? Thanks in advance Richard

    Read the article

  • Cannot use a Like query in a JSP prepared statement?

    - by SeerUK
    OK, first the query code and query: ps = conn.prepareStatement("select instance_id, ? from eam_measurement where resource_id in (select RESOURCE_ID from eam_res_grp_res_map where resource_group_id = ?) and DSN like '?' order by 2"); ps.setString(1,"SUBSTR(DSN,27,16)"); ps.setInt(2,defaultWasGroup); ps.setString(3,"%Module=jvmRuntimeModule:freeMemory%"); rs = ps.executeQuery(); while (rs.next()) { bla blah blah blah ... Returns an empty resultSet. Through basic debugging I have found its the 3rd bind that is the problem i.e. DSN like '?' I have tried all kinds of variations, the most sensible of which seemed to be using: DSN like concat('%',?,'%') bit that doesn' work as I am missing the ' ' either side of the concatenated string so I try DSN like ' concat('%',Module=P_STAG_JDBC01:poolSize,'%') ' order by 2 but I just can't seem to find a way to get them in that works. What am I missing? :) Thanks!

    Read the article

  • How do I do "nested if" in JSTL for Java JSP?

    - by user678616
    I want to do something like the following: <c:choose> <c:when test="${empty example1}"> </c:when> <c:otherwise> <c:when test="${empty example2}"> </c:when> <c:otherwise> </c:otherwise> </c:otherwise> </c:choose> Is this even possible? I get an exception thrown when trying to run. Thank you.

    Read the article

  • ??????????????JSF2????Web????????????Java Developers Workshop 2012 Summer????

    - by ???02
    ???WebLogic Server 12c?????Java EE 6????1???Web??????????????????????JavaServer Faces 2(JSF2)????????????????????????????????????????8???????Java Developers Workshop 2012 Summer??????????????????Java?????????????(Fusion Middleware????????)????????????????(???) JSF2??10?????AJAX??Web?????????????? ?????? Fusion Middleware???????? ???Java?????????????? Java EE 6????Web?????????????·????????????JSF2??Struts???Java EE???????Web????????·????????????????????????????????????????JSF2????????????Web??????????????UI??????????????????????????? ??????????Java EE?????????????????????????????????Java EE 6?JSF2??????????????????“????????”?????????????Java EE 6???????????????????????JSF2????????·???????????????????????????????????????????????????????? ??????????????GlassFish????????NetBeans???????????????????????????????????????11??????????????????????????????????????????(???)???? ???????????????????Web?????????????????????????????????????????????????????????????? ????AJAX???????????????????????????????????????????????????·????????????????????????? ????????????????NetBeans???????????????????????????????????????????????????·?????????????????????????????????????????????? ???????????????????????JSF2?????????AJAX???????????·??????????????????????????????????????????????????????????????Web????????????????????AJAX????????????JSF???????????1?????????? ?Java EE????????????????????????????Java EE 6??AJAX??????????????????????????????????????XML???????????NetBeans?????IDE???????????????????????????????????(???) ???????·?????????????????????? JSF 2????????????????????????Web??????(?????)?????????????????????????????3???????????? ??????????Visual Basic?JavaFX?????????????·????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? JSF2???MVC??????HTTP???????????????????Controller???Faces Servlet?????View?????XHTML??????Model?????Managed Bean????????????? ?????View???????????JavaServer Pages(JSP)?????????????????????XHTML????????????????View???????????????????????JSP????Scriptlet???????????????????????????????????????????????????? JSF2???View?Model??????????????????????????????????????????????????????????? ?????????JSF2????????1???HTML???Web????????????????????????JSF???Web????????????????????????????????????????HTML????????????????????????HTML 4.0?DHTML???????????????????????JavaScript??????????????????????JavaScript???????????Web?????????resources???????????????????????JSF2?????????????????Web??????????????? ????????????????????????????????????????????????·???????Web?????????????????????????????????????? ?????????????????????????????????????????????????????????????????????????? ????JSF???????????????????????????????????????????? ????JSP?????????????????????????????????????????????????????HTML????Web??????????????????????????????????JSP?Web???????????????????????????????????????????????????XHTML????JSF????????View???JSF2?????????????????????????????????????/??????????? JSF???????????????? ????????????????????????JSF?????????????????????????????????JSF2????????????????????????????????????? Web?????????????????XHTML????????JSF?Facelets?Web???(View)???UIComponent?????????? ??View?????????????????????????????View(UIComponent???)?????? ??????View?????????????????????? ???????????????Bean Validation????????????????????? ???JSF2??@FacesValidator??????????????????????????????????????????????????Validator?implements??????validate????????????????????????????????????????????????? ????????????????Model?POJO????????????????ManagedBean?JPA Entity?????????Value?????????????????????????Component??????????????????Component?????????????????1????????????????????????????????????????????? JSF2??????????????????JSF 1.2???????????·????XML?????????????????JSF2?????????????????????????????????????????????????????????? ???JSF???Web?????????????????????ManagedBean?CDI(Contexts and Dependency Injection)???POJO????????????????????????????????????????????????????????????????????????ManagedBean???????????????????????????????????????????????????????????????????????? ??????????????????????JSF???????????????????????????????????????JSF2??????????????????????????????????????????????? ????????????????JSF?Web??????????????????????????????????????·????????????????????????????JSF????????????????????????????????????????????????????????????????

    Read the article

  • Why does @PostConstruct callback fire every time even though bean is @ViewScoped? JSF

    - by Nitesh Panchal
    Hello, I am using datatable on page and using binding attribute to bind it to my backing bean. This is my code :- <?xml version='1.0' encoding='UTF-8' ?> <!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:p="http://primefaces.prime.com.tr/ui"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:form prependId="false"> <h:dataTable var="item" value="#{testBean.stringCollection}" binding="#{testBean.dataTable}"> <h:column> <h:outputText value="#{item}"/> </h:column> <h:column> <h:commandButton value="Click" actionListener="#{testBean.action}"/> </h:column> </h:dataTable> </h:form> </h:body> </html> This is my bean :- package managedBeans; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.component.html.HtmlDataTable; @ManagedBean(name="testBean") @ViewScoped public class testBean implements Serializable { private List<String> stringCollection; public List<String> getStringCollection() { return stringCollection; } public void setStringCollection(List<String> stringCollection) { this.stringCollection = stringCollection; } private HtmlDataTable dataTable; public HtmlDataTable getDataTable() { return dataTable; } public void setDataTable(HtmlDataTable dataTable) { this.dataTable = dataTable; } @PostConstruct public void init(){ System.out.println("Post Construct fired!!"); stringCollection = new ArrayList<String>(); stringCollection.add("a"); stringCollection.add("b"); stringCollection.add("c"); } public void action(){ System.out.println("Clicked!!"); } } Please tell me why is the @PostConstruct firing each and every time i click on button? It should fire only once as long as i am on same page beacause my bean is @ViewScoped. Further, if i remove the binding attribute then everything works fine and @PostConstruct callback fires only once. Then why every time when i use binding attribute? I need binding attribute and want to perform initialisation tasks like fetching data from webservice, etc only once. What should i do? Where should i write my initialisation task?

    Read the article

  • What are the principles of developing web-applications with action-based java frameworks?

    - by Roman
    Background I'm going to develop a new web-application with java. It's not very big or very complex and I have enough time until it'll "officially" start. I have some JSF/Facelets development background (about half a year). And I also have some expirience with JSP+JSTL. In self-educational purpose (and also in order to find the best solution) I want to prototype the new project with one of action-based frameworks. Actually, I will choose between Spring MVC and Stripes. Problem In order to get correct impression about action-based frameworks (in comparison with JSF) I want to be sure that I use them correctly (in bigger or lesser extent). So, here I list some most-frequent tasks (at least for me) and describe how I solve them with JSF. I want to know how they should be solved with action-based framework (or separately with Spring MVC and Stripes if there is any difference for concrete task). Rendering content: I can apply ready-to-use component from standard jsf libraries (core and html) or from 3rd-party libs (like RichFaces). I can combine simple components and I can easily create my own components which are based on standard components. Rendering data (primitive or reference types) in the correct format: Each component allow to specify a converter for transforming data in both ways (to render and to send to the server). Converter is, as usual, a simple class with 2 small methods. Site navigation: I specify a set of navigation-cases in faces-config.xml. Then I specify action-attribute of a link (or a button) which should match one or more of navigation cases. The best match is choosen by JSF. Implementing flow (multiform wizards for example): I'm using JSF 1.2 so I use Apache Orchestra for the flow (conversation) scope. Form processing: I have a pretty standard java-bean (backing bean in JSF terms) with some scope. I 'map' form fields on this bean properties. If everything goes well (no exceptions and validation is passed) then all these properties are set with values from the form fields. Then I can call one method (specified in button's action attribute) to execute some logic and return string which should much one of my navigation cases to go to the next screen. Forms validation: I can create custom validator (or choose from existing) and add it to almost each component. 3rd-party libraries have sets of custom ajax-validators. Standard validators work only after page is submitted. Actually, I don't like how validation in JSF works. Too much magic there. Many standard components (or maybe all of them) have predefined validation and it's impossible to disable it (Maybe not always, but I met many problems with it). Ajax support: many 3rd-party libraries (MyFaces, IceFaces, OpenFaces, AnotherPrefixFaces...) have strong ajax support and it works pretty well. Until you meet a problem. Too much magic there as well. It's very difficult to make it work if it doesn't work but you've done right as it's described in the manual. User-friendly URLs: people say that there are some libraries for that exist. And it can be done with filters as well. But I've never tried. It seems too complex for the first look. Thanks in advance for explaning how these items (or some of them) can be done with action-based framework.

    Read the article

  • IDEA modular problem (jsp)

    - by Jeriho
    I have project in with 2 separate modules(frontend and backend, first depends on second). When I'm trying to access backend code from frontend code, things going fine. Things turn for the worse when I do the same from jsp. This is stacktrase for simple accessign bean <jsp:useBean id="mybean" class="backend.main.MyBean" scope="request"></jsp:useBean> org.apache.jasper.JasperException: /results.jsp(9,0) The value for the useBean class attribute backend.main.MyBean is invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1220) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1178) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417) org.apache.jasper.compiler.Node$Root.accept(Node.java:495) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) org.apache.jasper.compiler.Generator.generate(Generator.java:3416) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231) org.apache.jasper.compiler.Compiler.compile(Compiler.java:347) org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) org.apache.jasper.compiler.Compiler.compile(Compiler.java:314) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) And this error will appear if I try to access regular class: An error occurred at line: 12 in the jsp file: /results.jsp backend.main.RegularClass cannot be resolved to a type Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439) org.apache.jasper.compiler.Compiler.compile(Compiler.java:349) org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) org.apache.jasper.compiler.Compiler.compile(Compiler.java:314) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) Sorry for so many stacktraces.

    Read the article

  • How can I get popup window using commandButton in Trinidad?

    - by vikram
    How can I get popup window using commandButton in Trinidad? My problem is that by clicking on Add button from dialogdemo.jspx, not any popup window or dialog box is opened. This is dialogdemo.jspx file: <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:tr="http://myfaces.apache.org/trinidad" version="1.2"> <jsp:directive.page contentType="text/html;charset=utf-8" /> <f:view> <tr:document title="Dialog Demo"> <tr:form> <!-- The field for the value; we point partialTriggers at the button to ensure it gets redrawn when we return --> <tr:inputText label="Pick a number:" partialTriggers="buttonId" value="#{launchDialog.input}" /> <!-- The button for launching the dialog: we've also configured the width and height of that window --> <tr:commandButton text="Add" action="dialog:chooseInteger" id="buttonId" windowWidth="300" windowHeight="200" partialSubmit="true" useWindow="true" returnListener="#{launchDialog.returned}" /> </tr:form> </tr:document> </f:view> </jsp:root> Here is the associated managed bean LaunchDialogBean.java: package jsfpkg; import org.apache.myfaces.trinidad.component.UIXInput; import org.apache.myfaces.trinidad.event.ReturnEvent; public class LaunchDialogBean { private UIXInput _input; public UIXInput getInput() { return _input; } public void setInput(UIXInput input) { _input = input; } public void returned(ReturnEvent event) { if (event.getReturnValue() != null) { getInput().setSubmittedValue(null); getInput().setValue(event.getReturnValue()); } } } Here is the popup file Popup.jspx: <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:trh="http://myfaces.apache.org/trinidad/html" xmlns:tr="http://myfaces.apache.org/trinidad" version="2.0"> <jsp:directive.page contentType="text/html;charset=utf-8" /> <f:view> <tr:document title="Add dialog"> <tr:form> <!-- Two input fields --> <tr:panelForm> <tr:inputText label="Number 1:" value="#{chooseInteger.value1}" required="true" /> <tr:inputText label="Number 2:" value="#{chooseInteger.value2}" required="true" /> </tr:panelForm> <!-- Two buttons --> <tr:panelGroup layout="horizontal"> <tr:commandButton text="Submit" action="#{chooseInteger.select}" /> <tr:commandButton text="Cancel" immediate="true" action="#{chooseInteger.cancel}" /> </tr:panelGroup> </tr:form> </tr:document> </f:view> </jsp:root> For that I have written the bean ChooseIntegerBean.java package jsfpkg; import org.apache.myfaces.trinidad.context.RequestContext; public class ChooseIntegerBean { private Integer _value1; private Integer _value2; public Integer getValue1() { return _value1; } public void setValue1(Integer value1) { _value1 = value1; } public Integer getValue2() { return _value2; } public void setValue2(Integer value2) { _value2 = value2; } public String cancel() { RequestContext.getCurrentInstance().returnFromDialog(null, null); return null; } public String select() { Integer value = new Integer(getValue1().intValue() + getValue2().intValue()); RequestContext.getCurrentInstance().returnFromDialog(value, null); return null; } } Here is my faces-config.xml: <managed-bean> <managed-bean-name>chooseInteger</managed-bean-name> <managed-bean-class>jsfpkg.ChooseIntegerBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>launchDialog</managed-bean-name> <managed-bean-class>jsfpkg.LaunchDialogBean</managed-bean-class> <managed-bean-scope> request </managed-bean-scope> </managed-bean> <navigation-rule> <from-view-id>/dialogdemo.jspx</from-view-id> <navigation-case> <from-outcome>dialog:chooseInteger</from-outcome> <to-view-id>/dialogbox.jspx</to-view-id> </navigation-case> </navigation-rule>

    Read the article

  • Technical Article: Oracle Magazine Java Developer of the Year Adam Bien on Java EE 6 Simplicity by Design

    - by janice.heiss(at)oracle.com
    Java Champion and Oracle Magazine Java Developer of the Year, Adam Bien, offers his unique perspective on how to leverage new Java EE 6 features to build simple and maintainable applications in a new article in Oracle Magazine. Bien examines different Java EE 6 architectures and design approaches in an effort to help developers build efficient, simple, and maintainable applications.From the article: "Java EE 6 consists of a set of independent APIs released together under the Java EE name. Although these APIs are independent, they fit together surprisingly well. For a given application, you could use only JavaServer Faces (JSF) 2.0, you could use Enterprise JavaBeans (EJB) 3.1 for transactional services, or you could use Contexts and Dependency Injection (CDI) with Java Persistence API (JPA) 2.0 and the Bean Validation model to implement transactions.""With a pragmatic mix of available Java EE 6 APIs, you can entirely eliminate the need to implement infrastructure services such as transactions, threading, throttling, or monitoring in your application. The real challenge is in selecting the right subset of APIs that minimizes overhead and complexity while making sure you don't have to reinvent the wheel with custom code. As a general rule, you should strive to use existing Java SE and Java EE services before expanding your search to find alternatives." Read the entire article here.

    Read the article

  • 2011 Tech Goal Review

    - by kerry
    A year ago I wrote a post listing my professional goals for 2011.  I thought I would review them and see how I did. Release an Android app to the marketplace – Didn’t do it.  In fact, haven’t really touched Android much since I wrote that.  I still have some ideas but am not sure if I will get around to it. Contribute free software to the community – I did do this.  I have been collaborating with others via github more lately. Regularly attend a user group meetings outside of Java – Did not do this.  Family life being what it is makes this not that much of a priority right now. Obtain the Oracle Certified Web Developer Certification – Did not do this.  This is not much of a priority to me any more. Learn scala – I am about 50/50 on this one.  I read a few scala books but did not write an actual application. Write an app using JSF – Did not do this.  Still interested. Present at a user group meeting – I did a Maven presentation at the Java user group. Use git more, and more effectively – Definitely did this.  Using it on a daily basis now. Overall, I got about halfway on my goals.  It’s not too bad since I did do a few things that weren’t on my list. Learned to develop applications using GWT and deploy them to Google App Engine Converted one of my sites from PHP to Ruby / Sinatra (learning to use it in the process) Studied up on the HTML 5 features and did a lot of Javascript development

    Read the article

  • How to use Twitter4j With JSF2 for Login? [on hold]

    - by subodh
    I am trying to do login with Twitter and using Twitter4j for that and wrote this code In JSF <h:commandButton id="twitterbutton" value="Sign up with Twitter" action="#{twitterLoginBean.redirectTwitterLogin}" immediate="true" styleClass="twitterbutton"/> In ManagedBean public String redirectTwitterLogin() throws ServletException, IOException, TwitterException { HttpServletRequest request = (HttpServletRequest) FacesContext .getCurrentInstance().getExternalContext().getRequest(); HttpServletResponse response = (HttpServletResponse) FacesContext .getCurrentInstance().getExternalContext().getResponse(); Twitter twitter = TwitterFactory.getSingleton(); twitter.setOAuthConsumer(apiKey, apiSecret); RequestToken requestToken = twitter.getOAuthRequestToken(); if (requestToken != null) { AccessToken accessToken = null; BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); while (null == accessToken) { try { String pin = br.readLine(); accessToken = twitter .getOAuthAccessToken(requestToken, pin); } catch (TwitterException te) { System.out .println("Failed to get access token, caused by: " + te.getMessage()); System.out.println("Retry input PIN"); } } request.setAttribute(IS_AUTHENTICATED, true); if (accessToken != null) { LOGGER.debug("We have a valid oauth token! Make the facebook request"); doApiCall(twitter, request, response); return null; } } else { LOGGER.debug("We don't have auth code yet, fetching the Authorization URL..."); String authorizationUrl = requestToken.getAuthorizationURL(); LOGGER.debug("Redirecting to the Authorization URL: {}", authorizationUrl); request.setAttribute(IS_AUTHENTICATED, false); redirect(authorizationUrl, response); return null; } return null; } In above code i want first Login window of twitter will show and then again same method will call and after user will login i can show user information userId,Handel,location etc. Redirect private void redirect(String url, HttpServletResponse response) throws IOException { String urlWithSessionID = response.encodeRedirectURL(url); response.sendRedirect(urlWithSessionID); } But this code is not working Can anyone tell better Solution for this ?

    Read the article

  • Emacs on Windows: how to protect built-in el files from being accidentally edited

    - by RamyenHead
    On Linux, they are all read only, so no problem. But on MS Windows, what happens is like this: I get curious about the definition of the command isearch-forward, I type C-h f isearch-forward and click on the link isearch.el from the help to get to the definition of the function, and while I am reading its definition, I press C-h or C-c many times, but I set Caps Lock as another Ctrl key, so sometimes it happens that I release Caps Lock too early, in which case C-h or C-c becomes inserting h or c, sometimes I notice that and undo it, but sometimes I don't notice it, and I even save them all with C-x s. What is a good way to protect the built-in el files from me on MS Windows?

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >