Syntax Tags in Jsp and Jsp 1.1

Sorry,
          Could you please tell me what is the syntax JSP1.0 and syntax JSP 1.1 for
          the tags in these pages.
          Thansk for you
          

see http://java.sun.com/products/jsp
          

Similar Messages

  • Applet to JSP and JSP to C++

    I am looking for some information and sample code for
    (1)Java Applets to JSP connection
    (2)JSP to server-side functions written in C++
    Thanks in advance.

    I am looking for some information and sample code for
    (1)Java Applets to JSP connection
    Look out for it [url http://www.unix.org.ua/orelly/java-ent/servlet/ch10_02.htm]here
    It shows applet-servlet communication. By making minor changes to it, you can setup applet - jsp communication as well.
    (2)JSP to server-side functions written in C++Refer to the previous post.
    All the best.

  • Comparing JSP and JSF, which 1 better?

    Currently i need to run a new project. Now i need to choosing 1 of the language to coding my project. Which 1 is better to use?
    In this project i have to include the web page that using JSP scriptlet to code because this project is create a dynamic menu to link up all web application. Is the JSF can link to JSP and JSP can link back to JSF?

    Welcome to SCN.
    Please read forum rules (you'll see that you must search the forum first (your question is already answered))

  • Problem sending form with fmt:message key=" " / tag system and jsp code

    I have developt my new web page using jsp. I have done a booking form, please se below here. There are two pages, bookings.jsp and booking_sent.jsp. The page has 6 different languages so i have also used the <fmt:message key=" " /> tag system for each language.
    The problem i have is when i send the form it opens a page where you only see all the tags, no text at all. For more information follow this link and try out the form;
    http://www.neptunediving.com/neptune/general/bookings.jsp/
    When you fill out the form and click send you should come to booking_sent and you do but the page is only full of tags, no text. Booking_sent looks exactly the same as bookings, except the header so why should not this work. I have tried everything but i cannot solve this problem. So i wonder if there is anybody out there who can help me with this?
    BOOKINGS.JSP
    <%@page import="com.neptunediving.*"%>
    <%@include file="../WEB-INF/include/LangSupport.jsp"%>
    <%@page contentType="text/html; charset=ISO-8859-1" language="java"%>
    <!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">
    <head>
    <title><fmt:message key="bookings.title1" /></title>
    <META NAME="description" Content="<fmt:message key="bookings.description1" />
    <fmt:message key="bookings.description2" />
    <fmt:message key="bookings.description3" />">
    <meta name="keywords" CONTENT="<fmt:message key="bookings.keywords1" />
    <fmt:message key="bookings.keywords2" />
    <fmt:message key="bookings.keywords3" />">
    <meta name="robots" CONTENT="index, follow">
    <link rel="shortcut icon" href="favicon.ico" >
    <meta name="Copyright" CONTENT="Cebu Neptune Diving Adventure, Inc. Copyright (c) 1996-2007">
    <meta name="Author" CONTENT="Jesper Nykvist">
    <META NAME="revisit-after" CONTENT="45 days">
    <META NAME="classification" CONTENT="diving">
    <META NAME="classification" CONTENT="scuba">
    <META NAME="classification" CONTENT="accommodation">
    <META NAME="classification" CONTENT="travel">
    <META NAME="classification" CONTENT="restaurants">
    <META NAME="distribution" CONTENT="global">
    <meta name="FreeFind" content="neverFollowScript">
    <meta name="FreeFind" content="noFollowQueries">
    <link href="../stylesheet/neptunediving.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <a name="Return"></a>
    <div class="pageHead">
    <div align="center"><%@include
         file="../WEB-INF/include/header.jsp"%></div>
    </div>
    <table class="nav" cellspacing="0">
         <tbody>
              <%@include file="../WEB-INF/include/bookings.jsp"%>
              <table width="100%" height="362" cellspacing="0" class="listTable">
                   <tbody>
                        <tr class="subhead">
                             <td width="54%" height="31"><%@include
                                  file="../WEB-INF/include/freefind.jsp"%></td>
                             <td width="46%">
                             <h1><span class="date"> <%@include
                                  file="../WEB-INF/include/showtime.jsp"%> </span></h1>
                             </td>
                        </tr>
                        <tr>
                             <td height="169" colspan="2">
                             <h2 align="center" class="listTable"><fmt:message key="general.bookings.header1" /></h2>
                             <h2 align="center" class="listTable"><fmt:message key="general.bookings.header2" /></h2>
                             <hr />
                             <p align="center"><fmt:message key="general.bookings.header3" />
                             <fmt:message key="general.bookings.header4" />
                             <fmt:message key="general.bookings.header5" /></p>
                             <p align="center"><fmt:message key="general.bookings.header6" />
                             <fmt:message key="general.bookings.header7" />
                             <fmt:message key="general.bookings.header8" /></p>
                             <hr />
                             </td>
                        </tr>
                        <tr>
                                       <td height="20" colspan="2">
                                       <form id="bookings" name="bookings" method="post"
                                       action="booking_sent.jsp">
                                       <h2 class="newsBody"><fmt:message key="general.bookings.header9" /></h2>
                                       <table width="100%" border="1" cellpadding="4">
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text1" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="from" size="30"
                                            maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text2" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="email" size="30"
                                            maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text3" /></p>
                                       </td>
                                       <td width="30%"><select name="region">
                                            <option><fmt:message key="general.bookings.text4" /></option>
                                            <option><fmt:message key="general.bookings.text5" /></option>
                                            <option><fmt:message key="general.bookings.text6" /></option>
                                            <option><fmt:message key="general.bookings.text7" /></option>
                                            <option><fmt:message key="general.bookings.text8" /></option>
                                            <option><fmt:message key="general.bookings.text9" /></option>
                                            <option><fmt:message key="general.bookings.text10" /></option>
                                            <option><fmt:message key="general.bookings.text11" /></option>
                                            <option><fmt:message key="general.bookings.text12" /></option>
                                            <option><fmt:message key="general.bookings.text13" /></option>
                                            <option><fmt:message key="general.bookings.text14" /></option>
                                       </select>
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text15" /></p>
                                       </td>
                                       <td width="30%"><select name="language">
                                            <option><fmt:message key="general.bookings.text16" /></option>
                                            <option><fmt:message key="general.bookings.text17" /></option>
                                            <option><fmt:message key="general.bookings.text18" /></option>
                                            <option><fmt:message key="general.bookings.text19" /></option>
                                            <option><fmt:message key="general.bookings.text20" /></option>
                                            <option><fmt:message key="general.bookings.text21" /></option>
                                            <option><fmt:message key="general.bookings.text22" /></option>
                                            <option><fmt:message key="general.bookings.text23" /></option>
                                            <option><fmt:message key="general.bookings.text24" /></option>
                                            <option><fmt:message key="general.bookings.text25" /></option>
                                            <option><fmt:message key="general.bookings.text26" /></option>
                                       </select>
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text27" />
                                       <fmt:message key="general.bookings.text28" />
                                       <fmt:message key="general.bookings.text29" /></p>
                                       </td>
                                       <td width="30%">
                                       <p class="listTable"><fmt:message key="general.bookings.text30" /><input type="radio"
                                            name="mailing" value="Yes" />
                                            <class="listTable"><fmt:message key="general.bookings.text31" /><input type="radio"
                                            name="mailing" value="No" checked="checked" /></p>
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text32" /></p>
                                       </td>
                                       <td width="30%"><select name="find us">
                                            <option><fmt:message key="general.bookings.text33" /></option>
                                            <option><fmt:message key="general.bookings.text34" /></option>
                                            <option><fmt:message key="general.bookings.text35" /></option>
                                            <option><fmt:message key="general.bookings.text36" /></option>
                                            <option><fmt:message key="general.bookings.text37" /></option>
                                            <option><fmt:message key="general.bookings.text38" /></option>
                                            <option><fmt:message key="general.bookings.text39" /></option>
                                            <option><fmt:message key="general.bookings.text40" /></option>
                                            <option><fmt:message key="general.bookings.text41" /></option>
                                            <option><fmt:message key="general.bookings.text42" /></option>
                                       </select>
                                        </td>
                                  </tr>
                                  <tr>
                                       </table>
                                       <br />
                                       <h2 class="newsBody"><fmt:message key="general.bookings.text43" /></h2>
                                       <table width="100%" border="1" cellpadding="4">
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text44" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="flight no, from"
                                            size="30" maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text45" /></p>
                                       </td>
                                       <td width="30%"><input type="text"
                                            name="arrival time, place" size="30" maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text46" />
                                       <fmt:message key="general.bookings.text47" /></p>
                                       </td>
                                       <td width="30%">
                                       <p class="listTable"><fmt:message key="general.bookings.text48" /><input type="radio"
                                            name="transport" value="Pick-up" />
                                            <class ="listtable="listTable""><fmt:message key="general.bookings.text49" /><input type="radio"
                                            name="transport" value="Bus" checked="checked" /></p>
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text50" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="stay from" size="30"
                                            maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text51" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="stay to" size="30"
                                            maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text52" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="guests (adults)" size="30"
                                            maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text53" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="guests (children)" size="30"
                                            maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text54" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="rooms (fan)" size="30"
                                            maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text55" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="rooms (air-con)" size="30"
                                            maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                             </table>
                             <br />
                             <h2 class="newsBody"><fmt:message key="general.bookings.text56" /></h2>
                             <table width="100%" border="1" cellpadding="4">
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text57" /></p>
                                       </td>
                                       <td width="30%">
                                       <p class="listTable"><fmt:message key="general.bookings.text58" /><input type="radio"
                                            name="certified diver" value="Yes" />
                                            <class="listTable"><fmt:message key="general.bookings.text59" /><input type="radio"
                                            name="certified diver" value="No" checked="checked" /></p>
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text60" />
                                       <fmt:message key="general.bookings.text61" /></p>
                                       </td>
                                       <td width="30%">
                                       <p class="listTable"><fmt:message key="general.bookings.text62" /><input type="radio"
                                            name="introductory course" value="Yes" />
                                            <class ="listTable""><fmt:message key="general.bookings.text63" /><input type="radio"
                                            name="introductory course" value="No" checked="checked" /></p>
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text64" /></p>
                                       </td>
                                       <td width="30%"><select name="where to dive">
                                            <option><fmt:message key="general.bookings.text65" /></option>
                                            <option><fmt:message key="general.bookings.text66" /></option>
                                            <option><fmt:message key="general.bookings.text67" /></option>
                                       </select></td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text68" /></p>
                                       </td>
                                       <td width="30%"><select name="dive course(s)">
                                            <option><fmt:message key="general.bookings.text69" /></option>
                                            <option><fmt:message key="general.bookings.text70" /></option>
                                            <option><fmt:message key="general.bookings.text71" /></option>
                                            <option><fmt:message key="general.bookings.text72" /></option>
                                            <option><fmt:message key="general.bookings.text73" /></option>
                                            <option><fmt:message key="general.bookings.text74" /></option>
                                            <option><fmt:message key="general.bookings.text75" /></option>
                                            <option><fmt:message key="general.bookings.text76" /></option>
                                            <option><fmt:message key="general.bookings.text77" /></option>
                                            <option><fmt:message key="general.bookings.text78" /></option>
                                            <option><fmt:message key="general.bookings.text79" /></option>
                                            <option><fmt:message key="general.bookings.text80" /></option>
                                       </select>
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text81" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="other dive course"
                                            size="30" maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text82" /></p>
                                       </td>
                                       <td width="30%"><select name="divepackage / safari">
                                            <option><fmt:message key="general.bookings.text83" /></option>
                                            <option><fmt:message key="general.bookings.text84" /></option>
                                            <option><fmt:message key="general.bookings.text85" /></option>
                                            <option><fmt:message key="general.bookings.text86" /></option>
                                            <option><fmt:message key="general.bookings.text87" /></option>
                                            <option><fmt:message key="general.bookings.text88" /></option>
                                            <option><fmt:message key="general.bookings.text89" /></option>
                                            <option><fmt:message key="general.bookings.text90" /></option>
                                            <option><fmt:message key="general.bookings.text91" /></option>
                                            <option><fmt:message key="general.bookings.text92" /></option>
                                            <option><fmt:message key="general.bookings.text93" /></option>
                                       </select>
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text94" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="dive package or safari from" size="30"
                                            maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.bookings.text95" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="dive package or safari to" size="30"
                                            maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                  </table>
                             <br />
                             <h2 class="newsBody"><fmt:message key="general.bookings.text96" /></h2>
                             <fmt:message key="general.bookings.text97" />
                             <fmt:message key="general.bookings.text98" />
                             <fmt:message key="general.bookings.text99" /></p>
                             <div align="left"> <textarea name="comments" cols="55" rows="10"></textarea>
                             <div>
                             <br />
                             <input name="Submit" type="submit" value="<fmt:message key="general.bookings.button1" />" />
                             <input type="reset" name="Clear form and start again..!"
                             value="<fmt:message key="general.bookings.button2" />" /></p>
                             </form>
                             </td>
                        </tr>
                        <tr>
                             <td height="29" colspan="2"><a href="#Return"><img
                                  src='<%=URLHelper.getURL("images/arrow.gif")%>'
                                  alt="Return to top" width="21" height="21" border="0" /></a>
                                  <fmt:message key="general.bookings.link1" />
                             </td>
                        </tr>
                        <tr>
                             <td height="105" colspan="2">
                             <hr />
                             <div class="pageFoot">
                             <div align="center"><font size="-1"><b><font
                                  size="3" face="Verdana, Arial, Helvetica, sans-serif"> <%@include
                                  file="../WEB-INF/include/footer.jsp"%>
                             </div>
                             </td>
                        </tr>
                   </tbody>
              </table>
              <p><br style="clear: both;" />
              </p>
         </tbody>
    </table>
    </body>
    </html>
    BOOKING_SENT.JSP
    <%@page import="com.neptunediving.*"%>
    <%@include file="../WEB-INF/include/LangSupport.jsp"%>
    <%@page contentType="text/html; charset=ISO-8859-1" language="java"%>
    <%
         String message;
         message  = "Booking";
         message += "\r\nFrom: " + request.getParameter("from");
         message += "\r\nEmail: " + request.getParameter("email");
         message += "\r\nRegion: " + request.getParameter("region");
         message += "\r\nlanguage: " + request.getParameter("language");
         message += "\r\nMailing: " + request.getParameter("mailing");
         message += "\r\nFind us: " + request.getParameter("find us");
         message += "\r\nFlight: " + request.getParameter("flight no, from");
         message += "\r\nArrival: " + request.getParameter("arrival time, place");
         message += "\r\nPickup: " + request.getParameter("transport");
         message += "\r\nStay from: " + request.getParameter("stay from");
         message += "\r\nStay to: " + request.getParameter("stay to");
         message += "\r\nAdult: " + request.getParameter("guests (adults)");
         message += "\r\nChildren: " + request.getParameter("guests (children)");
         message += "\r\nFan: " + request.getParameter("rooms (fan)");
         message += "\r\nAir-con: " + request.getParameter("rooms (air-con)");
         message += "\r\nCertification: " + request.getParameter("certified diver");
         message += "\r\nIntroductory dive: " + request.getParameter("introductory course");
         message += "\r\nWhere to dive: " + request.getParameter("where to dive");
         message += "\r\nDive courses: " + request.getParameter("dive course(s)");
         message += "\r\nOther dive course: " + request.getParameter("other dive course");
         message += "\r\nDive package or safari: " + request.getParameter("divepackage / safari");
         message += "\r\nDive package or safari from: " + request.getParameter("dive package or safari from");
         message += "\r\nDive package or safari to: " + request.getParameter("dive package or safari to");
         message += "\r\nComments: " + request.getParameter("comments");
         Mailer mailer = new Mailer();
         mailer.sendMail(request.getParameter("from") + "<" + request.getParameter("email") + ">",
                   "booking_sent",
                   message);
    %>
    <!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">
    <head>
    <title><fmt:message key="booking_sent.title1" /></title>
    <META NAME="description" Content="<fmt:message key="booking_sent.description1" />
    <fmt:message key="booking_sent.description2" />
    <fmt:message key="booking_sent.description3" />">
    <meta name="keywords" CONTENT="<fmt:message key="booking_sent.keywords1" />
    <fmt:message key="booking_sent.keywords2" />
    <fmt:message key="booking_sent.keywords3" />">
    <meta name="robots" CONTENT="index, follow">
    <link rel="shortcut icon" href="favicon.ico" >
    <meta name="Copyright" CONTENT="Cebu Neptune Diving Adventure, Inc. Copyright (c) 1996-2007">
    <meta name="Author" CONTENT="Jesper Nykvist">
    <META NAME="revisit-after" CONTENT="45 days">
    <META NAME="classification" CONTENT="diving">
    <META NAME="classification" CONTENT="scuba">
    <META NAME="classification" CONTENT="accommodation">
    <META NAME="classification" CONTENT="travel">
    <META NAME="classification" CONTENT="restaurants">
    <META NAME="distribution" CONTENT="global">
    <meta name="FreeFind" content="neverFollowScript">
    <meta name="FreeFind" content="noFollowQueries">
    <link href="../stylesheet/neptunediving.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <a name="Return"></a>
    <div class="pageHead">
    <div align="center"><%@include
         file="../WEB-INF/include/header.jsp"%></div>
    </div>
    <table class="nav" cellspacing="0">
         <tbody>
              <%@include file="../WEB-INF/include/bookings.jsp"%>
              <table width="100%" height="362" cellspacing="0" class="listTable">
                   <tbody>
                        <tr class="subhead">
                             <td width="54%" height="31"><%@include
                                  file="../WEB-INF/include/freefind.jsp"%></td>
                             <td width="46%">
                             <h1><span class="date"> <%@include
                                  file="../WEB-INF/include/showtime.jsp"%> </span></h1>
                             </td>
                        </tr>
                        <tr>
                             <td height="169" colspan="2">
                             <h2 align="center" class="listTable"><fmt:message key="general.booking_sent.header1" /></h2>
                             <h2 align="center" class="listTable"><fmt:message key="general.booking_sent.header2" /></h2>
                             <hr />
                             <p align="center"><fmt:message key="general.booking_sent.header3" />
                             <fmt:message key="general.booking_sent.header4" />
                             <fmt:message key="general.booking_sent.header5" /></p>
                             <p align="center"><fmt:message key="general.booking_sent.header6" />
                             <fmt:message key="general.booking_sent.header7" />
                             <fmt:message key="general.booking_sent.header8" /></p>
                             <hr />
                             </td>
                        </tr>
                        <tr>
                                       <td height="20" colspan="2">
                                       <form id="bookings" name="bookings" method="post"
                                       action="booking_sent.jsp">
                                       <h2 class="newsBody"><fmt:message key="general.booking_sent.header9" /></h2>
                                       <table width="100%" border="1" cellpadding="4">
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text1" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="from" size="30"
                                            maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text2" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="email" size="30"
                                            maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text3" /></p>
                                       </td>
                                       <td width="30%"><select name="region">
                                            <option><fmt:message key="general.booking_sent.text4" /></option>
                                            <option><fmt:message key="general.booking_sent.text5" /></option>
                                            <option><fmt:message key="general.booking_sent.text6" /></option>
                                            <option><fmt:message key="general.booking_sent.text7" /></option>
                                            <option><fmt:message key="general.booking_sent.text8" /></option>
                                            <option><fmt:message key="general.booking_sent.text9" /></option>
                                            <option><fmt:message key="general.booking_sent.text10" /></option>
                                            <option><fmt:message key="general.booking_sent.text11" /></option>
                                            <option><fmt:message key="general.booking_sent.text12" /></option>
                                            <option><fmt:message key="general.booking_sent.text13" /></option>
                                            <option><fmt:message key="general.booking_sent.text14" /></option>
                                       </select>
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text15" /></p>
                                       </td>
                                       <td width="30%"><select name="language">
                                            <option><fmt:message key="general.booking_sent.text16" /></option>
                                            <option><fmt:message key="general.booking_sent.text17" /></option>
                                            <option><fmt:message key="general.booking_sent.text18" /></option>
                                            <option><fmt:message key="general.booking_sent.text19" /></option>
                                            <option><fmt:message key="general.booking_sent.text20" /></option>
                                            <option><fmt:message key="general.booking_sent.text21" /></option>
                                            <option><fmt:message key="general.booking_sent.text22" /></option>
                                            <option><fmt:message key="general.booking_sent.text23" /></option>
                                            <option><fmt:message key="general.booking_sent.text24" /></option>
                                            <option><fmt:message key="general.booking_sent.text25" /></option>
                                            <option><fmt:message key="general.booking_sent.text26" /></option>
                                       </select>
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text27" />
                                       <fmt:message key="general.booking_sent.text28" />
                                       <fmt:message key="general.booking_sent.text29" /></p>
                                       </td>
                                       <td width="30%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text30" /><input type="radio"
                                            name="mailing" value="Yes" />
                                            <class="listTable"><fmt:message key="general.booking_sent.text31" /><input type="radio"
                                            name="mailing" value="No" checked="checked" /></p>
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text32" /></p>
                                       </td>
                                       <td width="30%"><select name="find us">
                                            <option><fmt:message key="general.booking_sent.text33" /></option>
                                            <option><fmt:message key="general.booking_sent.text34" /></option>
                                            <option><fmt:message key="general.booking_sent.text35" /></option>
                                            <option><fmt:message key="general.booking_sent.text36" /></option>
                                            <option><fmt:message key="general.booking_sent.text37" /></option>
                                            <option><fmt:message key="general.booking_sent.text38" /></option>
                                            <option><fmt:message key="general.booking_sent.text39" /></option>
                                            <option><fmt:message key="general.booking_sent.text40" /></option>
                                            <option><fmt:message key="general.booking_sent.text41" /></option>
                                            <option><fmt:message key="general.booking_sent.text42" /></option>
                                       </select>
                                        </td>
                                  </tr>
                                  <tr>
                                       </table>
                                       <br />
                                       <h2 class="newsBody"><fmt:message key="general.booking_sent.text43" /></h2>
                                       <table width="100%" border="1" cellpadding="4">
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text44" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="flight no, from"
                                            size="30" maxlength="25" />
                                        </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text45" /></p>
                                       </td>
                                       <td width="30%"><input type="text"
                                            name="arrival time, place" size="30" maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text46" />
                                       <fmt:message key="general.booking_sent.text47" /></p>
                                       </td>
                                       <td width="30%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text48" /><input type="radio"
                                            name="transport" value="Pick-up" />
                                            <class ="listtable="listTable""><fmt:message key="general.booking_sent.text49" /><input type="radio"
                                            name="transport" value="Bus" checked="checked" /></p>
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text50" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="stay from" size="30"
                                            maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text51" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="stay to" size="30"
                                            maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text52" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="guests (adults)" size="30"
                                            maxlength="25" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td width="70%">
                                       <p class="listTable"><fmt:message key="general.booking_sent.text53" /></p>
                                       </td>
                                       <td width="30%"><input type="text" name="guests (children)" size="30"
                                            maxlength="25" />
                                        </td>
                              

    Nope, can't delete posts on this forum,
    I have developed my new web page using jsp. I have done a booking form,
    There are two pages, bookings.jsp and booking_sent.jsp.
    The page has 6 different languages so i have also used the <fmt:message key=" " /> tag system for each language.
    The problem i have is when i send the form it opens a page where you only see all the tags, no text at all.
    For more information follow this link and try out the form; http://www.neptunediving.com/neptune/general/bookings.jsp/
    When you fill out the form and click send you should come to booking_sent and you do but the page is only full of tags, no text. Booking_sent looks exactly the same as bookings, except the header so why should not this work. I have tried everything but i cannot solve this problem. So i wonder if there is anybody out there who can help me with this?
    Tried going to that URL and got an error page served by Apache Webserver
    Maybe you haven't got the correct connector going between the webserver and the application server?

  • Aggressive JSP and TAG file Compilation?

    I get JSP and TAG file compile errors only when I touch and save the file. Isn't there a way to get these to build automatically by the NitroX builder? I'm constantly getting Jasper compile errors at runtime and having problems when I rename/refactor code that is referenced by .tag files.
    Thanks,
    Mike

    Hi,
    Does this happen to all of your JSP files?
    Please check these settings and update the status:
    * Is your project associated with source control or present on local drive?
    * Window > Preferences > Workbench (General > workspace) - Build automatically
    * Project > Properties > Builders
    - Java Builder
    - NitroX AppXRay Builder
    Did the behavior change due to any of the recent modification/upgrade?
    What version of Eclipse & NitroX are you using?
    * Help > About NitroX > Click on Eclipse icon - Version & build id
    * Help > About NitroX > Click on NitroX icon - Version & build id
    Thanks,
    M7 Support

  • Taglib and JSP problem

    Hi!
    I cannot determine why I'm getting the following error:
    I've installed Apache Tomcat/4.0.6
    "PARSE error at line 6 column 19
    org.xml.sax.SAXParseException: Element type "taglib" must be declared."
    Can you tell why the parser does not recognize it?
    Appreciate any help.
    ele
    [my JSP]
    <%@ page language="java" import="java.lang.*,java.util.*,javax.servlet.jsp.*,java.io.PrintWriter,javax.servlet.http.HttpServletResponse,javax.servlet.jsp.JspWriter" %>
    <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
    [my web.xml]
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <display-name>SegDis</display-name>
    <description></description>
    <servlet>
    <servlet-name>ScriviPunto</servlet-name>
    <servlet-class>ScriviPunto</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>lanciaScriviPunto</servlet-name>
    <jsp-file>/lanciaScriviPunto.jsp</jsp-file>
    </servlet>
    <servlet>
    <servlet-name>segnalazione</servlet-name>
    <jsp-file>/segnalazione.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
    <servlet-name>ScriviPunto</servlet-name>
    <url-pattern>/scriviPunto</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>lanciaScriviPunto</servlet-name>
    <url-pattern>/lanciaScriviPunto.jsp</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>segnalazione</servlet-name>
    <url-pattern>/segnalazione.jsp</url-pattern>
    </servlet-mapping>
    <taglib>
         <taglib-uri>/WEB-INF/c.tld</taglib-uri>
         <taglib-location>/WEB-INF/c.tld</taglib-location>
    </taglib>
    </web-app>
    [the .tld file (downloaded from Sun)]
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>c</short-name>
    <uri>http://java.sun.com/jstl/core</uri>
    <display-name>JSTL core</display-name>
    <description>JSTL 1.0 core library</description>
    <validator>
    <validator-class>
         org.apache.taglibs.standard.tlv.JstlCoreTLV
    </validator-class>
    <init-param>
         <param-name>expressionAttributes</param-name>
         <param-value>
         out:value
         out:default
         out:escapeXml
         if:test
         import:url
         import:context
         import:charEncoding
         forEach:items
         forEach:begin
         forEach:end
         forEach:step
         forTokens:items
         forTokens:begin
         forTokens:end
         forTokens:step
         param:encode
         param:name
         param:value
    redirect:context
    redirect:url
         set:property
         set:target
         set:value
         url:context
         url:value
         when:test
         </param-value>
         <description>
         Whitespace-separated list of colon-separated token pairs
         describing tag:attribute combinations that accept expressions.
         The validator uses this information to determine which
         attributes need their syntax validated.
         </description>
    </init-param>
    </validator>
    <tag>
    <name>catch</name>
    <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
    <body-content>JSP</body-content>
    <description>
    Catches any Throwable that occurs in its body and optionally
    exposes it.
    </description>
    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>choose</name>
    <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
    <body-content>JSP</body-content>
    <description>
    Simple conditional tag that establishes a context for
    mutually exclusive conditional operations, marked by
    <when> and <otherwise>
    </description>
    </tag>
    <tag>
    <name>out</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.OutTag</tag-class>
    <body-content>JSP</body-content>
    <description>
         Like <%= ... >, but for expressions.
    </description>
    <attribute>
    <name>value</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>default</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>escapeXml</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>if</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.IfTag</tag-class>
    <body-content>JSP</body-content>
    <description>
    Simple conditional tag, which evalutes its body if the
    supplied condition is true and optionally exposes a Boolean
    scripting variable representing the evaluation of this condition
    </description>
    <attribute>
    <name>test</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>import</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.ImportTag</tag-class>
    <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
    <body-content>JSP</body-content>
    <description>
         Retrieves an absolute or relative URL and exposes its contents
         to either the page, a String in 'var', or a Reader in 'varReader'.
    </description>
    <attribute>
    <name>url</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>varReader</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>context</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>charEncoding</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>forEach</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.ForEachTag</tag-class>
    <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
    <body-content>JSP</body-content>
    <description>
         The basic iteration tag, accepting many different
    collection types and supporting subsetting and other
    functionality
    </description>
    <attribute>
         <name>items</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>begin</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>end</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>step</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>var</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>varStatus</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>forTokens</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.ForTokensTag</tag-class>
    <body-content>JSP</body-content>
    <description>
         Iterates over tokens, separated by the supplied delimeters
    </description>
    <attribute>
         <name>items</name>
         <required>true</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>delims</name>
         <required>true</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>begin</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>end</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>step</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>var</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
         <name>varStatus</name>
         <required>false</required>
         <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>otherwise</name>
    <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class>
    <body-content>JSP</body-content>
    <description>
         Subtag of <choose> that follows <when> tags
         and runs only if all of the prior conditions evaluated to
         'false'
    </description>
    </tag>
    <tag>
    <name>param</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.ParamTag</tag-class>
    <body-content>JSP</body-content>
    <description>
         Adds a parameter to a containing 'import' tag's URL.
    </description>
    <attribute>
    <name>name</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>value</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>redirect</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.RedirectTag</tag-class>
    <body-content>JSP</body-content>
    <description>
         Redirects to a new URL.
    </description>
    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>url</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>context</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>remove</name>
    <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
    <body-content>empty</body-content>
    <description>
         Removes a scoped variable (from a particular scope, if specified).
    </description>
    <attribute>
    <name>var</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>set</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.SetTag</tag-class>
    <body-content>JSP</body-content>
    <description>
         Sets the result of an expression evaluation in a 'scope'
    </description>
    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>value</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>target</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>property</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>url</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.UrlTag</tag-class>
    <body-content>JSP</body-content>
    <description>
         Prints or exposes a URL with optional query parameters
    (via the c:param tag).
    </description>
    <attribute>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>value</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>context</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <name>when</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.WhenTag</tag-class>
    <body-content>JSP</body-content>
    <description>
    Subtag of <choose> that includes its body if its
    condition evalutes to 'true'
    </description>
    <attribute>
    <name>test</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    </taglib>

    this is a wild guess, but make sure the taglib text you added to your web.xml doens't contain funky characters you may have copied from some web page. i.e. retype it by hand if you copied it.
    If that isn't it.. sorry i don't see a problem.

  • What is the diff between jsp and servlet

    is thr any other difference betwwen jsp and servlet, tht: jsp is automatic generated servlet and jsp has different types of tag, due this we have write less amount of code.any other technically difference between these two?

    As you mentioned JSP automatically gets converted into a Servlet and then compiled. From the server's perspective other than the transformation process, there is no real difference.
    However, in coding there are some minor differences such as additional access to pre-defined variables and different syntax for some minor things such as imports and etc.
    Perhaps somebody else more knowledgeable can fill you in further.
    Hope that was helpful.

  • Problem with JNDI and JSP in Tomcat

    Hi,
    Basically, what I've done is to use the Tomcat administration web
    application to create the DataSource, which looks like it populated the
    server.xml (see below). I then try to access the testconn.jsp, and am
    getting that "Name java:comp is not bound in this Context" error.
    I was wondering if anyone could tell me what I'm doing wrong?
    Thanks,
    Feri
    My Configuration:
    - Tomcat 5.0.19
    - MySQL 4.0.18-nt
    - mysql-connector-java-3.0.15-ga-bin.jar
    server.xml:
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <!--Feri test JNDI-->
         <Context crossContext="true" debug="5" docBase="injury" path="/injury" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_injury_log." suffix=".txt" timestamp="true"/>
              <Resource name="jdbc/injury" auth="Container"
    type="javax.sql.DataSource">
    </Resource>
    <ResourceParams name="jdbc/injury">
         <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>
    <parameter>
    <name>username</name>
    <value>root</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>root</value>
    </parameter>
         <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
         <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost:3306/injury</value>
    </parameter>
         <parameter>
              <name>maxIdle</name>
              <value>30</value>
         </parameter>
         <parameter>
              <name>maxActive</name>
              <value>10</value>
         </parameter>
         <parameter>
              <name>maxWait</name>
              <value>10000</value>
         </parameter>
    </ResourceParams>
         </Context>
    <!--Feri test JNDI end-->
    </GlobalNamingResources>
    \webapps\injury\WEB-INF\web.xml:
    <resource-ref>
    <description>Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file.</description>
    <res-ref-name>jdbc/injury</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    \webapps\injury\testconn.jsp
    <%@ page import="java.sql.*" %>
    <%@ page import="javax.sql.*" %>
    <%@ taglib prefix="ct" uri="/injury" %>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
    <h1>Connection test</h1>
    <ct:connection name="jdbc/injury">
    <%
    Statement stmt= conn.createStatement();
    ResultSet rs;
    rs = stmt.executeQuery("select * from user");
    while (rs.next()){
    %><%=rs.getString(1)%><%=rs.getInt(2) %><br><%
    rs.close();
    stmt.close();
    %>
    </ct:connection>
    ConnectionTag.java
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import javax.naming.*;
    import javax.sql.*;
    import javax.sql.DataSource;
    public class ConnectionTag extends TagSupport implements TryCatchFinally {
    private Connection conn;
    // JNDI name of the connection
    private String name;
    public void setName(String name)
         this.name = name;
    public int doStartTag()
         throws JspException
         try {
         Context env = (Context) new InitialContext().lookup("java:comp/env");
         DataSource ds = (DataSource) env.lookup(name);
         if (ds != null)
              conn = ds.getConnection();
         } catch (Exception e) {
         throw new JspException(e);
         if (conn == null)
         throw new JspException("can't open connection " + name);
         pageContext.setAttribute("conn", conn);
         return EVAL_BODY_INCLUDE;
    public void doCatch(Throwable t)
         throws Throwable
         throw t;
    public void doFinally()
         try {
         Connection conn = this.conn;
         this.conn = null;
         pageContext.removeAttribute("conn");
         conn.close();
         } catch (Exception e) {
    Tomcat 5.0\conf\Catalina\localhost\injury.xml
    <?xml version='1.0' encoding='utf-8'?>
    <Context displayName="Injury" docBase="E:\Tomcat 5.0\webapps\injury" path="/injury" className="org.apache.catalina.core.StandardContext"
    cachingAllowed="true" charsetMapperClass="org.apache.catalina .util.CharsetMapper" cookies="true" crossContext="false" debug="0"
    mapperClass="org.apache.catalina.core.StandardContextMapper" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper" >
    <Resource auth="Container" description="Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file." name="jdbc/injury" type="javax.sql.DataSource"/>
    <ResourceLink global="jdbc/injury" name="injury" type="javax.sql.DataSource"/>
    </Context>

    Hi,
    First of all, you can find alot of information about this in the forum about jsp's.
    I think a good thing to do is not to put your context tag directly into the server.xml file.
    What you should do is create a context.xml file with the context-tag in it, and put it in the META-INF directory of your .war file. Upon deployment to tomcat5 this file will be extracted from the war, copied to the conf\enginename\hostname directory, and it will be renamed to contextName.xml.
    I think you are developing directly into the webapps directory, and I believe you should avoid that and use the deployment feature of the manager web-app or you should use the deployertool from you ide or standalone ant.
    anyway, for starters try to remove the context tag from the server.xml file as described above, and check out the jsp / jdbc forums for simular problems and answers.
    good luck

  • Can a Servlet be used for Storing Objects with both JSP and JSF used on it?

    Hi,
    Pages I have:
    SearchEmployee.jsp
    This page has a search engine that search out the Employee. This Employee Object will be stored inside a Servlet(controller) for future references by other pages. I used JSP, html tags for forms, and request.getParameter() to built this search engine.
    Problem:
    I have a JSF Form that wants to DISPLAY the employee which I have found in my Search Engine. How can I get the JSF's value="#{Controller.employeeObj.name}" to get the value from the object?
    This seems logical as my JSF form is just retrieving the stored object in the Controller. I currently cant seem to output it

    The servlet shouldn't be used to store ANY data, let alone data to be accessed by other sevlets. Put the object into the Session object.

  • Whats the difference between *.jsp and *.jspx

    Hi
    When I create a new jsf page the first step prompts me for the "type". I am wondering what is the difference between JSP Page and JSP Document? Which should I be using? Are there any white papers or documents that explain the advantages of each?
    Also, someone suggested that I use Facelets, has anyone else used these from inside jdeveloper? Any thoughts / tips would be appreciated.
    Thanks
    troy

    JSPX uses an XML doument for you page code - it is the way we recommend you build your page. Makes for cleaner code and easier customization.
    JSP uses HTML with embedded JSF tags in it.

  • Tree View through JSP and Java Script

    Hi,
    I am looking for code or ideas of a Tree Structure as shown in in the left side frame of admin console of Sun App server 7 on the browser. I need to create a tree structure which will work on the browser like it works on the Sun App Server 7 admin console. If you had any idea or code, please share with me. I would like to have some idea before I start building it. The tree will be build from the database. So any database design is also helpful. I am planning to have that tree using JSP and EJB.
    Please help. If you are not clear what I am looking for, then please drop a line in this forum, so that I can explain it fine.
    Thanks in advance.
    Amit

    You can use the JSP Tree Tag I have developed. This helps you both structuring the tree model itself + it takes care of displaying the tree in a nice way. You can change all HTML code used to display the tree. Also you can build trees dynamically instead of just displaying static trees. Take a look at it here:
    http://www.jenkov.dk/projects/treetag/treetag.jsp
    Kind Regards,
    Jakob Jenkov

  • Need help in JSP and Servlets

    Hi friends,
    [please forgive me if i am posting this in the wrong forum, all seems same to a fresher]
    Now, to my problem..i need a suggestion, a way or a method to implement the following!
    I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task?
    Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSP
    Thanks in adavance

    arun_ramachandran wrote:
    [please forgive me if i am posting this in the wrong forum, all seems same to a fresher]Then you should learn to be more observant - after all, we have JSP and Servlet fora, further down the list. :)
    I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task? You can store the data in your session object. You can even use JavaBeans and the jsp:usebean tag.
    [http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html]
    Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSPA wise approach - I wish more prople woiuld be as thoughtful.

  • Best practice for dealing with Recordsets, JDBC and JSP?

    I've spent the last three years developing web apps using JSP, Struts and Kodo JDO for persistence. All of the content for the apps was created as Java objects using model classes and saved to an Oracle db. Thus, data retrieved from the db was as instances of the model classes and then put into Struts form beans, etc.
    I changed jobs last month and am now having to use Servlets with JDBC to retrieve records from db tables and returning it into Recordsets. Oh, and I can't use Struts in my JSPs either. I'm beginning to think that I had it easy at my previous job but maybe that's just because I was used to it.
    So here are my problems/questions:
    I have two tables with a one to many relationship that I need to retrieve data from, show in a jsp and be able to update eventually.
    So here's what I am doing:
    a) In a servlet, I use a SQL statement to join the tables and retrieve the results into a Recordset.
    b) I created a class with a bunch of String attributes to copy the Recordset data into, one Recordset row per each instance of the bean and then close the Recordset
    c) I then add the beans to an ArrayList and save the ArrayList into the session.
    d) Then, in the JSP, I retrieve the ArrayList from the session and iterate over each bean instance, printing the data out to the jsp. There are some logic statements to determine when not to print redundant data caused by the one to many join.
    e) I have not written the code to update the data yet but was planning on having separate jsps for updating the (one) table and the (many) table.
    Would most of you do something similar? Would you use one SQL statement to retrieve all of the data for display and use logic to avoid printing the redundant part of the data? Or would you have used separate SQL queries, one for each table? Would you have saved the results into something other than an instance of a bean class that represents one record in the RecordSet? Would you have had a bean class with attributes other than Strings - like had a collection attribute to hold the results from the "many" table? The way that I am doing everything just seems so cumbersome and difficult compared to using Struts and JDO before.
    Your help/opinion will be greatly appreciated!

    Would you use one SQL statement to retrieve all of the data for display Yes.
    and use logic to avoid printing the redundant part of the dataNo.
    I believe in minimising the number of queries. If it is a simple one-many join on a db table, then one query is better than one + n queries.
    However I prefer to store the objects in a bean class with attributes other than strings - ie one object, with a collection attribute to hold the related "many" records.
    Does the fact you are not using Struts mean that you have to use scriptlet code? (shudder)
    Or are you using JSTL, or other custom tags?
    How about tools like Ant? Junit testing?
    The way that I am doing everything just seems so cumbersome and difficult
    compared to using Struts and JDO before.Anything different takes adjusting to. Sounds like you know what you're doing for the most part. I agree, in terms of best practices what you have described so far sounds like a step backwards from what you were previously doing.
    However I wouldn't go complaining about it too loudly, too quickly. If you're new on the block theres nothing like making a pain of yourself, and complaining how backwards the work they have done is to put your new workmates' backs up
    Look on it as a challenge. Maybe discuss it quietly with a team leader, to see if they understand how much easier/better/less error prone such approaches can be?
    Struts, cumbersome as it can be, definitely has the advantage of pushing you to follow good MVC practice.
    Good luck,
    evnafets

  • JSP and Servlets - when to use which?

    Greetings,
    I am a software developer with a very good understanding of Java. I build web applications, console applications, server/client apps, gui apps, what have you.. Web development with Java seems so dynamic now, that I can't seem to keep up with it. I have a simple style of developing web apps with java. Basically I create Java DTO(Data Transfer Object) classes that will perform in the backend and talk to a database using JDBC, or write to file, or read from file, what have you. I develop JSP pages that produce the proper HTML based on what a user wants to see. I may create some functionality in the DTOs that will pass along certain data. Sometimes the JSP can get a little sloppy due to the nature of the app. I create forms that collect information using JSP/HTML and I create JSP pages that will extract the form data from the form page and then send that data to the DTOs for further processing. I am not creating any classes that implement or extend HttpServlet and this is starting to bother me. Is this more the accepted way of developing Java Web Apps? What could you consider these DTOs I am creating? Can these be considered servlets? I compile the classes and use them as if they were a servlet, but they really aren't right? I am not sure and I need to catch up with what's going on in the real world. This is the unfortunate part of never having anyone to mentor you. I feel like I am falling behind. What about the newer technologies emerging - Struts, Tiles, JSF, what have you.. Could these possibly be replacing the functionality of Servlets? Thanks for listening...
    takizzle

    There's no reason to slam anyone that's asking advice on a HELP FORUM.
    anyway, that aside-
    I usually use JSPs for presentation and show database views with them. take for example a shopping basket application, you would have a custom tag that would loop through the contents of the customer's shopping cart and display them.
    however when the customer was filling out thier information the form would point at a servlet that would handle the logic and processing.
    that's the diff- user servlets to handle logic and JSPs to handle presentation.
    cheers, and good luck :)

  • Dynamic include in a custom tag, called from a jsp

    Hello, I would like to be able to dynamically include other jsp's from within a custom tag that I create. is this possible?
    in a jsp page i would just write <%@ include file="file.jsp" %> and all would be ok... but if i do an out.println( "<%@ include file=\"file.jsp\" %>" ); inside a custom tag bean then it doesn't work. it just prints out the command to the page as plain text.
    I do understand why this is happening, but can anyone offer me a way around this problem?
    Thanks in advance,
    Randy

    That's actually the same result as you get with a normal include - The method I suggested is a dynamic include similar to the <jsp:include> tag, not the <%@ include %> tag.
    When you use a dynamic include, the included page is compiled and 'invoked' as serarately, and the result is what gets included, not the actual source. To get the behaviour you want would require an include directive (the <%@ include %> tag) which I don't think has an equivalence you can use inside a custom tag.
    What you can do is pass attributes from the tag class like this:
    pageContext.setAttribute(<name>, <object>, pageContext.REQUEST_SCOPE);
    and then remove them after the include using pageContext.removeAttribute.
    I'm not certain, but this implies that if you declare your variables with a <jsp:usebean> tag with request scope, instead of normal Java variable declarations, you should be able to use them in the page included by the custom tag.
    *** in the jsp ***
    <jsp:useBean id="myVar" scope="request" class="java.lang.String" />
    <% myVar = "Something"; %>
    // Now call the tag which uses the pageContext.include() mehtod.
    *** end ***
    *** in the include ***
    <jsp:useBean id="myVar" scope="request" class="java.lang.String" />
    <%= myVar + " something else" %>
    *** end ***
    Let me know if it works.

Maybe you are looking for