Search Results

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

Page 48/148 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • Is there a Java equivalent for Ruby on Rails "url_for"?

    - by Oren Ben-Kiki
    I have written something like this pretty easily in C# (string GetUrl(new { controller = "foo", action = "bar", baz = "fnord" }), based on the existing capabilities of the XmlRouteCollection class provided by the ASP.NET MVC framework (why it isn't there out of the box is beyond me; the additional required code was trivial). I am now faced with a JSP project, and I need the same ability: centralize the logic for generating all URLs in one place, based on a list of routing rules. Is there some code somewhere I could reuse/adapt to do this in Java? It seems like a common enough requirement, but google proved surprisingly unhelpful in finding something like this.

    Read the article

  • Tomcat servlet-api.jar problem

    - by CitadelCSCadet
    I am running a web application using Tomcat and Java Servlets, JSP's, etc. I am aware that in order to use Servlets, it is dependent on the Servlet-api.jar file. Initially I placed this jar file in the WEB-INF/lib/ directory. This has worked fine for me for months during the developmental phase. When we put the application onto the server space we are using, we started seeing wierd problems showing up in the Catalina.out file telling us that there was dependency problems with the servlet-api.jar file. I am aware that tomcat has this jar file in its container, and that I should remove it from the WEB-INF/lib/ directory. I have tried this and it does not work. What do I have to do when I remove this jar file from the local files and allow it to depend on tomcats servlet-api.jar file.

    Read the article

  • Java: Convenient way to refactor the application.

    - by Harshal
    Hi, Everyone We have an agile enterprise application built on JSP and Servlet without any design strategy. This application was built in early 2002 considering 1000 users. After 2002, we received lots of requests from the marketing partners. Currently, the application has lots of spaghetti code with lots of Ifs and elses. One class has more than 20,000 lines of code with a huge body of functions without abstraction. Now, we need to support billions of records, what we need to do immediately and gradually? We have to refactor the application? Which framework, we need to use? How the usage of the framework will be helpful to the end users? How to convince the leaders to do the refactoring? How to gain the faster response time as compare to the current system?

    Read the article

  • req.getParameter returns values wrong character encoding

    - by coder247
    I'm trying to get values from a JSP using getParameter which includes ü,é,à etc. But get wrong values in servlet. I've checked the content type with firebug and found that Content-Type text/html;charset=UTF-8 checked the POST section with firebug and found the correct value there, when I try to access it in servlet it is wrong. Gives ö instead of ö req.getCharacterEncoding(); returns null. Tried with setting req.setCharacterEncoding("UTF-8"); at the beginning of servlet but didn't help.

    Read the article

  • JavaScript Validation

    - by Sandeep Pathak
    Have a text field in the jsp which shows and takes input for ftp Url like below : ftp://ftplog:*****@10.203.291.177/abc/DS/Simulator/B11/B11/L2 The password field above is masked . Now when user tries the edit say ftp to sftp or File Path , He should re-type the password too , other wise What I will be getting in server is only "*" . Can somebody suggest the best way of validating this . It has a lot of test cases that has to be taken care of . Thanks .

    Read the article

  • Using static strings to define input field names in JSPs - good idea or not?

    - by Derek Clarkson
    Hi all, I've just be asked to work on a large portal project and have been looking through the established code. I keep finding this in the jsps: <input class="portlet-form-button" name="<%=ModifyUserProfile.FORM_FIRST_TIME_LOGIN_SUBMIT%>" type="submit" ... The authors are using static strings defined in classes to define the names of input fields and buttons in jsp forms. I've never seen this done before and was wondering if this is common practice. I'm inclined to think not, but I'm asking because, apart from centralising names which I would have thought are not likely to change, I can't see the reason why. Any thoughts on this?

    Read the article

  • Special characters incongruence

    - by Enrique
    Hello I'm building a Spring MVC web application that runs on Tomcat 6.0.20 and JDK 1.6.0_19. When I send some special characters through an HTML form some of them are stored as question marks ? For example these symbols are stored correctly: €, á, é, í, ‰, etc But some symbols are replaced with ? like: £, ?, ? MySQL tables charset is utf-8. My jsp also use utf-8 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> I have included org.springframework.web.filter.CharacterEncodingFilter in web.xml as suggested here When I debug the POST request when sending 3 characters €a£ with firebug I get: %E2%82%ACa%E2%82%A4 which is correct since E2 82 AC is the code for € and E2 82 A4 is the code for £ but £ is stored as ? in the database. When I save £ directly into the database it is displayed correctly in the webpage. How can I fix this?

    Read the article

  • MVC Framework for existing application.

    - by Dhruva
    I am modifying existing java web application that was written long time ago, and it is written in the wrost possible way. It has business logic and sql statemens in JSP files. Because of the certain constraint, I can not re-design the entire application. but I can implement better design in any new feature that I add. can anybody suggest me any MVC framework that I could easily integrate in existing app. I need to have framework that is not depended on many external jar files and it does not cause any issues with existing application.

    Read the article

  • How to get the action from the HttpServlet request to dispatch to multiple pages

    - by JFB
    I am using the Page Controller pattern. How could I use the same controller for two different pages by detecting the request action and then dispatching according to the result? Here is my code: account.jsp <form name="input" action="<%=request.getContextPath() %>/edit" method="get"> <input type="submit" value="Modifier" /> </form> Account Servlet public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("received HTTP GET"); String action = request.getParameter("action"); if (action == null) { // the account page dispatch(request, response, "/account"); } else if (action == "/edit") { // the popup edit page dispatch(request, response, "/edit"); } protected void dispatch(HttpServletRequest request, HttpServletResponse response, String page) throws javax.servlet.ServletException, java.io.IOException { RequestDispatcher dispatcher = getServletContext() .getRequestDispatcher(page); dispatcher.forward(request, response); } }

    Read the article

  • Mixing expressions and expression language (<%= %> inside of c:if)

    - by Jack
    I need to access some constants in my jsp, and sadly the EL does not offer any functionality for it. There are some options like the unstandard tag library, but I'd like to keep it a bit more standard. I tried: <%@ page import = "com.jackdane.Constants"%> <c:if test="${object.display == '<%=com.jackdane.Constants.YES %>}'"> //some display logic </c:if> But that doesn't appear to do the trick. It's been a while since I've used an expression so I might have made an error. Any input is appreciated. Edit: To clarify, the constants class is not in my control. It's inside a jar file that I recieved. It contains no getters/setters. Just private static final Strings.

    Read the article

  • Does every browser open a new HTTPSession

    - by user496934
    I am working on a webbased application which has JSP and servlets. In my application, I am binding some objects to sessions like the following code -- HttpSession session = p_req.getSession(); session.setAttribute(DOWNLOAD_With_WARNINGS, downloadMap); Later I am retrieving them using session.getAttribute. I would like to know if every time I open a new browser does it open a new HTTP session. Because , if I do a setAttribute with some value in one browser instance, that change is visible when I do a getAttribute using the other browser instance.

    Read the article

  • outlook calendar connectivity with java web service

    - by Isisagate
    We currently have a java/jsp online web service that includes it's own custom calendar. I am trying to do some research into the possibility of connecting it to a users outlook. Our basic needs that are most simple is some way to sent the person a meeting request that can be added to their outlook from our service. I know the ideal solution is to sync back and forth but simply being able to import the data from our calendar into someone's outlook would be sufficient. Does anyone have any resources they can point me to that might help with information gathering, or any example/comments?

    Read the article

  • @ExceptionHandler doesn't handle the thrown exceptions

    - by Javi
    Hello, I have a method in my controller which will handle the exceptions thrown by the application. So I have a method like this one. @Controller public class ExceptionController { @RequestMapping(value="/error") @ExceptionHandler(value={Exception.class, NullPointerException.class}) public String showError(Exception e, Model model){ return "tiles:error"; } } And to try I if it works I throw a NullPointerException in another method in other method controller: boolean a = true; if(a){ throw new NullPointerException(); } After the exception is thrown it is printed in the JSP, but it doesn't go throw my showError() method (I've set a breakpoint there and it never enters). showError() method will catch the exception and will show different error pages depending on the exception type (though now it always shows the same error page). If I go to the url /error it shows the error page so the showError() method is OK. I'm using Spring 3. What can be the problem? Thanks.

    Read the article

  • table changes depending on ddl values with servlet

    - by kawtousse
    I will be more clear. What I want to realize is the following: In a JSP x I have a 3 dropdownlists and a button called edit when user click this button a table dynamically should be displayed. Now this table is modified correponding the values in those 3 ddl. So it can be 3 cols or 4 cols or even 6 cols it depends on the selected values. So what I tried is to use the servlet to getParameter doing the if clause construct the html and then forward the response.Have you any the suggestion of the structure that I can use. Think you.

    Read the article

  • reload a form with the same parameter of the previous

    - by kawtousse
    Hi every one, I have really a problem that I don't know how to deal with it. I am using JSP and Servlet with the Eclipse IDE. First of all, the user fill an html table with the values that he has selected and written in the form. after that he will find his parameters displayed in the html table. the problem now is : the table contains in each row an edit button when clicking on it; the user should have the form automatically filled with values"previously selected" of the row. so it's how to reload the form with variables from html table. Note : I construct the table with a servlet. Please help.

    Read the article

  • Buttons size not equal in IE and Firefox

    - by Anurag
    I have few buttons on my jsp page and I am using the style as : .buttonblue { background-color: #003366; border-color: #99CCFF; color: #FFFFFF; font-family: Verdana,Arial,Helvetica; font-size: 8pt; font-weight: bold; height: 20px; display:inline; line-height: 1.2; text-align: center; margin-top: 2px; } In Firefox the buttons are bit smaller than IE6. I can not define the size of buttons as the caption changes the button size changes accordingly. I tried with width:auto but no success. Also, with overflow:visible the buttons in IE becomes bit smaller. Please help.

    Read the article

  • Getting a java collection of objects in Alphabetical order

    - by MichaelMcCabe
    I have a question that I dont really know where to start. So I thought i'd ask it here. Basically, I have a drop down with names in it. I want these names to be in alphabetical order. Populating the drop down happens as follows; I query a database and pull down an Id and Name, make a object called "UserList", and set the name and id variables with what I get back. I then add this object to an ArrayList. I do this over and over. I then convert this collection to an array, and pass it to my JSP page using session.setAttribute("userList", UserList); I then populate the drop down as below. <c:forEach items="${usersCompanysList}" var="c" > There probably is a simple answer but how to I sort these names?

    Read the article

  • How to reset a portlet parameter on a button click?

    - by aditibhat
    I have a Liferay portlet param "cmd" in my JSP page, which is initialized to a value "update". I need this value to be get changed to "delete", when a user clicks on the delete button of the form. How I can go about it? <liferay-portlet:actionURL varImpl="edit_survey_form_action"> <portlet:param name="cmd" value="update" /> <input class="optsurvey-submit" type="submit" name="submitButton" value="Delete" onclick="??????"/>

    Read the article

  • Java Web Application

    - by Mark R
    I am interested in creating a simple web application that will take in user input, convert it to an XML file and send the file to a database. Coding wise I feel I am okay, it is just the general setup and what implementation to use I am a bit unsure of. At the moment I have a JSP page containing a form, the user fills out the form and on submit a get method is sent to a servlet, in the servlet doGet() method the servlet is instantiating a java object and passing it the user inputted data. The java object then writes that data to an XML file and sends it to the database via REST. All I would be interested to know is if this the standard/optimal way of creating such a web application. Any and all feedback is appreciated. Thanks

    Read the article

  • Unable to recieve file contents on server during upload

    - by Khushal
    Hello, I have a JSP page in which I have a file input field from which I browse a csv file and then upload it on server. I am using method = "POST" and ENCTYPE='multipart/form-data' in the form in which this file input field is present. On the servlet side(in the application's servlet) I am making use of apache's commom file upload API-ServletFileUpload API. After getting the FileItem list from the method parseRequest(request) of this API I am unable to get the file name and its content by using the methods getName(), getString() of FileItem API. Needed to know what am I doing wrong or any modifications in my approach that will make my application to work. Any pointers regarding this will be helpful. Thanks in advance!!

    Read the article

  • JSTL request attribute in c:if

    - by JNPW
    I set an request attribute in my action class as follows: request.setAttribute("xFg",Boolean.TRUE); I want to retrive this in my JSP. I want to retrive them using JSTL tags. I tried this : <c:if test="${requestScope.xFg}"> <c:set var="showlist" value="true" /> </c:if> But c:if didnt work, i mean it didnt goto c:set I tried to print the sameusing c:out but nothing got displayed. What is wrong or How should i test request attribute value. I havent used requestScope so far. Is requestScope the option to get the request value? pls help.Thanks in advance.

    Read the article

  • RewriteRule dropping escaped parameter

    - by Gerd
    I need some help with the following RewriteRule: RewriteRule ^/iesearch/(.*)$ /jsp/search/ieaccelerators/visualsearch.jsp?q=$1 [L,PT] The intention is to rewrite search-queries from http://mydomain/iesearch/alvin+the+chip to a JSP. This works fine as long as the URL does not contain encoded characters such as: http://mydomain/iesearch/alvin+%26+the+chip. The rewrite log shows the following: (2) init rewrite engine with requested uri /iesearch/alvin+&+the+chip (2) rewrite '/iesearch/alvin+the+&+chip' - '/jsp/search/ieaccelerators/visualsearch.jsp?q=alvin+&+the+chip' (3) split uri=/jsp/search/ieaccelerators/visualsearch.jsp?q=alvin+&+the+chip - uri=/jsp/search/ieaccelerators/visualsearch.jsp, args=q=alvin+&+the+chip I would have hoped that the %26 is passed on instead of the &.

    Read the article

  • Validar Textbox para aceptar solo n&uacute;meros

    - by Jason Ulloa
    Una de las necesidades más habituales en el desarrollo es poder validar los controles Textbox para que solo acepten valore numéricos. En este post eso es lo que haremos, nos apoyaremos en el lenguaje javascript para validar nuestro textbox del lado del cliente. Nuestro primer paso será crear la función JavaScript que hará el trabajo, para ello agregamos las etiquetas de javascript <script type="text/javascript"> </script> Posteriormente dentro de esas etiquetas agregaremos el script que hará el trabajo function ValidNum(e) { var tecla= document.all ? tecla = e.keyCode : tecla = e.which; return ((tecla > 47 && tecla < 58) || tecla == 46); } Por último iremos al code behind de la página y en el evento Load agregaremos un nuevo evento al textbox para que reconozca el script. protected void Page_Load(object sender, EventArgs e) { TextBox1.Attributes.Add("onkeypress", "javascript:return ValidNum(event);"); } Con esto, tenemos el textbox validado para aceptar solo números y el punto.

    Read the article

  • Membership Provider Parte 1

    - by Jason Ulloa
    Asp.net ha sido una de las tecnologías creadas por Microsoft de mas rápido crecimiento por la facilidad para los desarrolladores de crear sitios web. Una de las partes de mayor importancia que tiene asp.net es el contar con el Membership Provider o proveedor de Membrecía, que permite la creación, manejo y mantenimiento de un sistema completo de control y autenticación de usuarios. Para dar inicio a la serie de post que escribiré sobre que es Membeship y cuáles son las funcionalidades principales daremos unas definiciones. Tal como se menciono anteriormente con el membership provider podemos crear un sistema de control de usuarios completos, entre las funcionalidades principales podemos encontrar: * Creación de usuarios * Almacenamiento de información en base de datos * Autenticación, bloqueos y seguimiento Otras de las ventajas que cabe resaltar, es que, algunos de los controles de asp.net ya traen "naturalmente" en sus funciones la implementación del membership provider, tal como el control "Login" o los controles de estado de usuario, lo cual nos permite que con solo arrastrarlos al diseñador estén funcionando. Membership provider es poderoso, pero su funcionalidad y seguridad se ven aumentadas cuando se integra con otros proveedores de asp.net como lo son RoleProvider y Profile Provider (estos los discutiremos en otros post). En la siguiente figura, podemos ver como se distribuyen algunoS provider creados por Microsoft Antes de iniciar con la implementación de membership debes conocer cosas básicas como el espacio de nombres al que pertenece, el cual es: System.Web.Security que se encuentra dentro del ensamblado System.Web. Algo que debe tomarse en cuenta, es que, para poder utilizar cualquiera de los miembros de la clase, debemos hacer la referencia respectiva. Por defecto, el membership provider está diseñado para trabajar directamente con SQL Server, de ahí que su nombre completo seria SQL Membership Provider. Sin embargo, debido a su gran flexibilidad podemos extenderlo a cualquier base de datos o bien modificarlo para adapatarlo a nuestras necesidades. En los siguientes posts, discutiremos como crear un proveedor personalizado utilizando Entity Framework, separando las capas de acceso y datos y cuáles son las principales funciones que podemos aplicar. En palabras básicas y sin entrar muy hondo en el tema, hemos descrito el objetivo del Membership Provider, para todos los que desean ampliar pueden hacerlo en: http://msdn.microsoft.com/es-es/library/system.web.security.membership%28v=vs.100%29.aspx

    Read the article

  • After rich:extendedDataTable sortby, other actions are not getting executed

    - by kksachin
    I have several tabs and one of the tabs uses rich:extendedDataTable. If sortBy is clicked in the page where table is used and if I navigate to another page, it looks for the bean of the old page and throws an error saying that sortyBy of the column is undefined. E.g. If I use sortBy on userId in tab1 (where the column must have sortBy="#{data.userId}") and then I click on tab2, it looks for the data.userId and throws an error. I am using Richfaces version 3.2.2SR1. Can anyone help me on this? Here is the complete trace: javax.el.PropertyNotFoundException: /amendapplication/historyDetails.xhtml @33,174 sortBy="#{data.statusChangeTime}": Property 'statusChangeTime' not found on type uk.gov.wales.rpd.domain.applicationmanagement.ApplicationAttributeEntity com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:73) org.richfaces.model.impl.expressive.ValueBindingExpression.evaluate(ValueBindingExpression.java:59) org.richfaces.model.impl.expressive.ObjectWrapperFactory.wrapObject(ObjectWrapperFactory.java:189) org.richfaces.model.ModifiableModel$RowKeyWrapperFactory.wrapObject(ModifiableModel.java:57) org.richfaces.model.impl.expressive.ObjectWrapperFactory$2.convert(ObjectWrapperFactory.java:177) org.richfaces.model.impl.expressive.ObjectWrapperFactory.convertList(ObjectWrapperFactory.java:138) org.richfaces.model.impl.expressive.ObjectWrapperFactory.wrapList(ObjectWrapperFactory.java:175) org.richfaces.model.ModifiableModel.sort(ModifiableModel.java:235) org.richfaces.model.ModifiableModel.modify(ModifiableModel.java:206) org.richfaces.component.UIExtendedDataTable.createDataModel(UIExtendedDataTable.java:310) org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:621) org.ajax4jsf.component.UIDataAdaptor.setRowKey(UIDataAdaptor.java:339) org.ajax4jsf.component.UIDataAdaptor.iterate(UIDataAdaptor.java:1034) org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1158) org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1168) javax.faces.component.UIForm.processDecodes(UIForm.java:209) org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:392) org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238) org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:409) com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177) org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267) org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >