Search Results

Search found 1850 results on 74 pages for 'jsp'.

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

  • Mixing JSP/HTML any new features or suggestions

    - by Maglebolia
    Hi all, I have a Web-Application, which is mainly JSP (file extension) and is including some HTML. It seems to me that the "general" way is "old" and not always well red by some IDE like Eclipse: Is there no other way to include jsp expression with "<% ... %". There is no need for a framework to resolve this, since we only have like 60 pages. I run through examples and see that we can seperate the code with blockquotes "< script < /script ". I'm really wondering which is the better method for understanding and easier reading of the code. Any formatting, syntax coloring, plugin or new code style suggestions would help. Here an example <%} %> <%if(condition) { %> <tr> <td class="label"><%=method()%></td> <td class="text"><%=method()%></td> </tr> <%} %> <tr>

    Read the article

  • JSP: Refresh ComboBox options

    - by framara
    Hi, There's a class 'Car' with brand and model as properties. I have a list of items of this class List<Car> myCars. I need to represent in a JSP website 2 ComboBox, one for brand and another for model, that when you select the brand, in the model list only appear the ones from that brand. I don't know how to do this in a dynamic way. Any suggestion where to start? Thanks Update Ok, what I do now is send in the request a list with all the brand names, and a list of the items. The JSP code is like: <select name="manufacturer" id="id_manufacturer" onchange="return getManufacturer();"> <option value=""></option> <c:forEach items="${manufacturers}" var="man"> <option value="${man}" >${man}</option> </c:forEach> </select> <select name="model" id="id_model"> <c:forEach items="${mycars}" var="car"> <c:if test="${car.manufacturer eq man_selected}"> <option value="${car.id}">${car.model}</option> </c:if> </c:forEach> </select> <script> function getManufacturer() { man_selected = document.getElementById('id_manufacturer').value; } </script> How do I do to refresh the 'model' select options according to the selected 'man_selected' ?

    Read the article

  • Two pass JSP page rendering

    - by dotsid
    Suppose an example. I have following interface: public interface DataSource<T> { Future<T> fetch(); } This datasource can do asynchronous data fetching. And we have following tag for using datasource in JSP: <html> <d:fetch from="${orderDS}" var="orders"> <c:foreach in="${orders}" var="order"> <div class="order"> <c:out value="${order.title}" /> </div> </c:foreach> </d:fetch> </html> So, what I want? I want JSP rendering engine to call my custom tag (FetchTag in this example) twice. On first call FetchTag will do DataSource.fetch() call and save Future locally as a object field. On second call FetchTag do Future.get() call and will be blocked until data becomes available. Is there any way to do such a thing?

    Read the article

  • servlet and jsp sending query result following MVC framework

    - by kawtousse
    Hi every one, in order to separate java code and html code and be more faithful to MVC framework i am coding like that; in the servlet i put the following: net.sf.hibernate.Session s = null; net.sf.hibernate.Transaction tx; try { s= HibernateUtil.currentSession(); tx=s.beginTransaction(); Query query = s.createQuery("select opcemployees.Nom,opcemployees.Prenom,dailytimesheet.TrackingDate,dailytimesheet.Activity," + "dailytimesheet.ProjectCode,dailytimesheet.WAName,dailytimesheet.TaskCode," + "dailytimesheet.TimeSpent,dailytimesheet.PercentTaskComplete from Opcemployees opcemployees,Dailytimesheet dailytimesheet " + "where opcemployees.Matricule=dailytimesheet.Matricule and dailytimesheet.Etat=3 " + "group by opcemployees.Nom,opcemployees.Prenom" ); for(Iterator it=query.iterate();it.hasNext();) { if(it.hasNext()){ Object[] row = (Object[]) it.next(); request.setAttribute("items", row); }} } catch (HibernateException e){ e.printStackTrace(); } request.getRequestDispatcher("EspaceValidation.jsp").forward(request, response); and in jsp i start like that: <table> <c:forEach items="${items}" var="item"> <tr> <td>? </td> <td>?</td> </tr> </c:forEach> in this case what should i put exactly to obtain my result.a table fulled with the right value from the request

    Read the article

  • Two forms but only 1 jsp file

    - by joshft91
    Here's what I've got going on. I have one .jsp file. However, I have two forms with multiple inputs inside those forms. What is the best way to detect that one form was submitted but not the other? Here's an example: I have this form: <form name = "login" action="index.jsp" method="get"> Username: <input id="username" name="username" type="text"/><br/> Password: <input id="password" name="password" type="password"/> <input type="submit" Value="Login" ></input> </form> If that button is clicked, I'd like to run this code: String username = request.getParameter("username"); String password = request.getParameter("password"); if((username!= null && !username.trim().equals("")) && (password != null && !username.trim().equals(""))) { DBentry DBentry=new DBentry(); boolean flag = DBentry.isTaken(username); if(flag) {%><script type="text/javascript">alert("Login Successful!");</script><% } else { %><script type="text/javascript">alert("Unrecognized username. Please register!");</script><% } } else { %><script type="text/javascript">alert("Please enter both a username and password!");</script><% } Further down I would have something exactly like it but submitting a different form. Thanks!

    Read the article

  • Work @ Java shop. Tasked to redo intranet. I only know PHP - CTO says use that; Ops Says no - we have JSP, use that - Thoughts?

    - by Mackysback
    So I work as a project manager and was given the opportunity to redo the intranet and Internet site... I'd love to , great addition to my resume. However.... I am not familiar with java nor JSP... I am fairly proficient with PHP and MySQL ... Also my intention was to use a CMS that I have experience with, wordpress, drupal or joomla... The site would be very simple so I was thinking wordpress would be fine for this. I told management that I would need it to run on PHP and they gave me their blessing... Now the disconnect bw it and management ... I spoke with ops and they told me that we have java and JSP for that purpose although the IT guy did say "oh but I do know that php and mysql are gaining popularity" That said ... I do not understand much as far as systems architecture... We do self host and run websphere with IIS and jboss with tomcat. Any advice or suggestions? Thanks ! Is my request that unfeasible?

    Read the article

  • Using SiteMesh with RequestDispatcher's forward()

    - by Rob Hruska
    I'm attempting to integrate SiteMesh into a legacy application using Tomcat 5 as my a container. I have a main.jsp that I'm decorating with a simple decorator. In decorators.xml, I've just got one decorator defined: <decorators defaultdir="/decorators"> <decorator name="layout-main" page="layout-main.jsp"> <pattern>/jsp/main.jsp</pattern> </decorator> </decorators> This decorator works if I manually go to http://example.com/my-webapp/jsp/main.jsp. However, there are a few places where a servlet, instead of doing a redirect to a jsp, does a forward: getServletContext().getRequestDispatcher("/jsp/main.jsp").forward(request, response); This means that the URL remains at something like http://example.com/my-webapp/servlet/MyServlet instead of the jsp file and is therefore not being decorated, I presume since it doesn't match the pattern in decorators.xml. I can't do a <pattern>/*</pattern> because there are other jsps that do not need to be decorated by layout-main.jsp. I can't do a <pattern>/servlet/MyServlet*</pattern> because MyServlet may forward to main.jsp sometimes and perhaps error.jsp at other times. Is there a way to work around this without expansive changes to how the servlets work? Since it's a legacy app I don't have as much freedom to change things, so I'm hoping for something configuration-wise that will fix this. SiteMesh's documentation really isn't that great. I've been working mostly off the example application that comes with the distribution. I really like SiteMesh, and am hoping I can get it to work in this case.

    Read the article

  • Get the selected value from a Select box and check that value against an array in the same form

    - by Rob Allen
    I'm new to JSTL/EL and JSP and can't seem to find a reference which covers the following scenario: I have an array of values in JavaScipt: var Countries = ('US', 'CA'); I then need to check to see if the currently selected value of a standard HTML select box is in that array. This is what I have so far: <select id="shippingCountry"> <option value="AT">Austria</option> <option value="CA">Canada</option> <option value="DE">Germany</option> //... <option value="US">United States</option> </select> <c:choose> <c:when test=" "> // I don't know what to put in the 'test' case <span class="required">*</span> </c:when> </c:choose>

    Read the article

  • Getting Response.End() behavior in JSP

    - by Sam Ingrassia
    Thanks to everyone in advance - I am aware of closing the jspwriter/outputstream and returning as a method to stop further execution in the main context. Has anyone found a way to stop execution outside of the main context? From my understanding of how jsp is 'compiled' etc I do not think this is possible, but I thought I should see if anyone has any clever solutions - Thanks, Sam

    Read the article

  • Accessing xml from jsp on tomcat server is throwing FileNotFoundException trying to access .keystore

    - by mobibob
    I am trying to access an XML file from JSP on my Tomcat server. The error is from Catalina's protocol handler and the exception is java.io.FileNotFoundException trying to access my .keystore in the 'documents and settings' folder for my signed-on user (with admin, but not the user that installed the server). I can provide the stacktrace if that would help ... but my question is more fundamental about secure access to files and where is the keystore configured / used on a Window's install?

    Read the article

  • Beans, Lists and JSP

    - by Luigi 1982
    Hi at All I have a little question... On my JSP page I have a List of beans. I want to extract a sublist of beans with a specific property (Ex. all Horror books). Can Apache Beanutils help me? Thanks in advance...

    Read the article

  • Servlet, JSP, JavaBeans and HTML form

    - by dedalo
    Hi, I'm working on a servlet that makes a connection to a database gets the information of one of the tables ans sends this information to a jsp file. This file will print on the brower the information table, adding radio buttons that allows us to choose one of the rows. The servlet looks like this: List<InfoBean> items = new ArrayList<InfoBean>(); if (!conexion.isClosed()){ Statement st = (Statement) conexion.createStatement(); ResultSet rs = st.executeQuery("select * from lista_audio" ); while (rs.next()) {items.add(getRow(rs));} conexion.close();} req.getSession().setAttribute("items", items); In the JSP file I can print a table with the information, adding radio buttons that the user will use to choose 1 row and send the selected info to a servlet using a form I can add: < form action="administ" method=get enctype=multipart/form-data> < table> < table border=\"1\">< tr>< th>Title< /th>< th>Author< /th>< th>Album< /th>< /tr> < c:forEach items="${items}" var="item"> < tr>< td><input type="radio" name="SongInfo" value=${item.title}> < td>${item.title}< /td> < td>${item.author}< /td> < td>${item.album}< /td>< /tr> < /c:forEach> < /table> In the field 'value' I should be able to send to the servlet the information stored in ${item.title}. When I set value = ${item.title} and title is, for example "The bodyguard", in the servlet the information I can retrieve is just "The". It looks like it sends the characters located before the first white space of the string. How could I get the whole string? Thanks

    Read the article

  • loop through HashMap Java jsp

    - by blub
    Hello, the related Questions couldn't help me very much. How can i loop through a HashMap in jsp like this example: <% HashMap<String, String> countries = MainUtils.getCountries(l); %> <select name="ccountry" id="ccountry" > <% //HERE I NEED THE LOOP %> </select>*<br/>

    Read the article

  • JSP/Servlet CRUD form with special input field based on join table relationship

    - by user1701467
    There's database with a bunch of tables that are joined with join tables. E.g. Members and Division are joined with MembersDivisions table. JSP/Servlet login functionality has been developed, but now the CRUD functionality needs to be implemented and I was unable to find any tutorials about it, especially involving the join table(when creating new division you can add members to it, or add more to the existing one). Maybe someone could, theoretically, explain how to do the Division part of the CRUD web form?

    Read the article

  • Fill a list from JSP in Spring

    - by Javi
    Hello, I have something like this in my Spring Application: public class Book{ public Book(){ sheets = new LinkedList<Sheet>(); } protected List<Sheet> sheets; //getter and setter } I add several Sheets to the sheet list and I print a form in a JSP like this: <form:form modelAttribute="book" action="${dest_url}" method="POST"> <c:forEach items="${mybook.sheets}" var="sheet" varStatus="status"> <form:hidden path="sheet[${status.count -1}].header"/> <form:hidden path="sheet[${status.count -1}].footer"/> <form:hidden path="sheet[${status.count -1}].operador"/> <form:hidden path="sheet[${status.count -1}].number"/> <form:hidden path="sheet[${status.count -1}].lines"/> </c:forEach> ... </form:form> I need to get back this list in the controller when the form is submitted. So in my controller I have a method with a parameter like this: public String myMethod (@ModelAttribute("book") Book book, Model model){ ... } The problem is that it doesn't fill the sheets list unless in the constructor of Book I add as much Sheet's as I want to get. The problem is that I don't know in advance the number of Sheets the book is going to have. I think the problem is that in my method it instantiates Book which has a list of sheets with 0 elements. When it tries to access to sheets[0] the list is empty and it doen't add a Sheet. I've tried to create a getter method for the list with an index parameter (so it can create the element if it doesn't exists in the list like in Struts framework) like this one: public Sheet getSheets(int index){ if(sheets.size() <= index){ Sheet sheet = new Sheet(); sheets.add(index, sheet); } Sheet sheetToReturn = sheets.get(index); if(sheetToReturn == null){ sheetToReturn = new Sheet(); sheets.add(index, sheetToReturn); } return sheetToReturn; } but with this method the JSP doesn't work because sheets has an invalid getter. What's the proper way of filling a list when you don't know the number of items in advanced? Thanks

    Read the article

  • servlet--call jsp file

    - by megala
    I created servlet program it contained the following coding. ======coding public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService { public String greetServer(String input) { Cal c=new Cal(); c.call(input); return "success"; } } =========My constraints is i want to call index.jsp from this servlet how to achieve this.

    Read the article

  • Recommend JSP Quiz Tutorials

    - by Sandeep Bansal
    Hi Everyone, I need to make a quiz that uses JSP and servlets but I can't find any tutorials online which can help me create my own one. If there are any can someone recommend me some, I have tried Google and nothing reasonable has come up. Thanks.

    Read the article

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