Jsp not locating javascript path!!!!!

Hello all,
m developing an application is struts with myeclipse6.0 IDE. now as soon as i login to the application i see admin.jsp page. In this admin.jsp i've two external javascript file one for generating jasper reports and for calendar pop-up function.Now the problem m facing is, on the first load of Admin.jsp my javascript file for gennerating reports works fine but its not looking the file for pop-up calendar.now if i go to other links from admin.jsp and come back again to admin.jsp thn javascript for calendar pop-up works fine but reports generation is giving error.........so it seems the path of javascript files is somehow correct coz on two different ocassions thy seems to work individually..........but why my admin.jsp is not looking both the javascript files simultaneously??????is it some path problem while configuring the project...m very new to this eclispe or something else i'm missing???????

One full stop is normally sufficient. Provided you have a capital letter starting the next sentence.
It is so much easier to read if you just take a bit more effort presenting your post in properly formatted English.
The issue will be related to the use of relative links to load the scripts.
These links are relative to the last url requested by the browser - the one displayed in the address bar (or the one you get if you right click the page and look at properties/page info)
It is NOT necessarily relative to your actual JSP. The browser knows nothing about server side forwards/includes that may have happened. All it knows about is the address/action you originally requested.
Your JSP: Web/jsp/admin.jsp
Your includes:
<script language="javascript" src="scripts/calendar/CalendarPopup.js"></script>
<script language="javascript" src="scripts/generatereports.js"></script>Your action: <html:form action="/abc.do">. --> presumably maps to /WEB/abc.do
So when you access the JSP directly via +"Web/jsp/admin.jsp"+, the base directory is "/Web/jsp", and it will go looking for Web/jsp/scripts/calendar/CalendarPopup.js, and finds it.
When you access it via your action +"/WEB/abc.do"+ the base directory is "/Web" it will go looking for _/WEB/scripts/calendar/CalendarPopup.js_ == WRONG LOCATION!
The solution: the html base tag. It tells the browser what url to resolve relative links from.
Seeing as you are using struts, putting <html:base/> in the <head> section of your your page should solve this issue, and generate a correct base tag for you.
ie<html>
  <head>
     <html:base/>
  </head>
  <body>
  </body>
</html>Cheers,
evnafets

Similar Messages

  • LR3 - "A file is not located at the specified path...."  AAAHHHHHHHH!!!!

    Please help.  I was edited a bunch of photos in LR3 last night and when I tried to export them they could not be exported.  Then when I right-click and ask to go to image in finder.  The dialogue comes up that says "file is not located at path..."   Images are avail in preview with all my edits, etc, but WHERE is the image in the library????????????????
    Please help guys!
    Thanks very much in advance.

    Beta issues should be posted to the Beta forum.
    If you have moved the image file to a new location outside of LR (using the OS rather than LR itself), you will need to tell LR where it is now. Right click on the image or the folder and select update location, then point to where you have moved the file to. This problem is often a result of using external disks on windows systems where the disk hasn't been allocated a specific drive letter...for some reason windows allocates different letters every time the disk is conected. You need to allocate a drive letter permanently to the disk in windows if this is the case on your system.

  • Including external Javascript file in JSP- not working on Mozilla Firefox

    I have a JSP page which includes javascript file as below:
    <script type="text/javascript" src="https://siteAddress/scripts/myJsFile.js"></script>
    myJsFile.js has a method testFireFox()
    There is a link on JSP which that calls this method.
    <a href="#" onClick="testFireFox()">Some Text...</a>
    As soon as i click on the link, nothing happens and this error appears on console:
    Refrence Error: testFirefox() is not definedI tried giving the path for JS file in various ways but it did not help.
    Note: This works absolutely fine in Internet Explorer.
    I have not added Javascript to document.ready or onLoad event. It is simply been referred in <Head>
    tag any pointers pls..

    This forum is intended for user support, not for web development issues.
    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The contributors over there are more knowledgeable about web page development issues with Firefox.
    http://forums.mozillazine.org/viewforum.php?f=25
    You'll need to register and login to be able to post in that forum.

  • JSP Registry could not locate runtime property file

              At runtime, my JSP is throwing an exception claiming to be not able to find the property
              file. I have found the exact property file in the jar located on the server. I've
              tried extracting it and placing it in different places and adding the file and directory
              to the WebLogic classpath. I'm not sure what else to try.
              Here's the exception:
              Loading from CLASSPATH cat_test4_cat_pkg_Cat_pkgModule.properties
              java.lang.RuntimeException: JSP Registry could not locate runtime property file:
              cat_test4_cat_pkg_Cat_pkgModule.properties
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              Thanks.
              

    When you generate a webapp or use the JSP element wizard , a property file is created for you that contains some startup parameters. This file needs to be available in the classpath. This errors comes up becuase the file is not avalable in the classpath.

  • Error Message: java.lang.RuntimeException: JSP Registry could not locate runtime prop

    Hi there
    Running Oracle Enterpride Edition 8.1.7
    including Oracle Http webserver
    I'm trying to run a JSP application developed with Jdeveloper
    through th http server
    Think I have modified alle the .conf files correctly
    I get the message :
    "Error Message: java.lang.RuntimeException: JSP Registry could not locate runtime property file:ORDERS_ORDERS_PKG_ORDERS_PKGModule.properties"
    Any ideas ?
    Or can anyone point me to a (proper) document that decribes (correctly and completely) alle the steps that need to be done ?
    Many Thanxs
    Regards TJ
    null

    I am also experiancing this problem. I have updated the ojsp to version 112200 and the properties file exist within the .jar used by the .jsp file.
    Exception:
    java.lang.RuntimeException: java.lang.RuntimeException: JSP Registry could not locate runtime property file:deseweb_DesewebModule.properties
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.(Compiled Code)
    at java.lang.Exception.(Compiled Code)
    at java.lang.RuntimeException.(RuntimeException.java:47)
    at morenet.jsp.JSPApplicationRegistry.registerApplicationFromProperties(JSPApplicationRegistry.java:199)
    at morenet.jsp.MorenetWebBeanImpl.internalInitialize(MorenetWebBeanImpl.java:119)
    at oracle.jdeveloper.html.WebBeanImpl.initialize(WebBeanImpl.java:56)
    at oracle.jdeveloper.html.DataWebBeanImpl.initialize(DataWebBeanImpl.java:395)
    at morenet.jsp.MorenetWebBeanImpl.initialize(MorenetWebBeanImpl.java:62)
    at apps.deseweb._index._jspService(_index.java:71)
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
    at oracle.jsp.JspServlet.internalService(Compiled Code)
    at oracle.jsp.JspServlet.service(JspServlet.java)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
    at org.apache.jserv.JServConnection.run(Compiled Code)
    at java.lang.Thread.run(Compiled Code)

  • TS1702 Apple Map is not showing the path as seen in the previous version. Not showing the direction between the locations.

    Apple map is not showing the paths between two locations as shown in the previous version.

    The current Maps app in iOS 6 is from Apple. It is beta software with known issues. The previous Maps app in iOS was from Apple, but used Google as the map resource. There is now a new Maps app from Google available in the iTunes App Store.

  • Jsp not compiling....

    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
    <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
    <%@ page import='com.uk.nhs.training.data.ActivityMatrix'%>
    <%@ page errorPage="ExceptionHandler.jsp"%>
    <SCRIPT language="JavaScript" type="text/javascript">
    function showBookingDays(id)
    var bookings = document.getElementsByName('booking');
    alert(bookings.length);
    for(i=0;i<=bookings.length;i++)
    if(bookingConflicts.bookings.checked==true)
    //showDiv(id);
    else
    bookingConflicts.bookings[i].checked=false;
    function showDiv(divId)
    var item = document.getElementById(id);
    alert("show item"+item);
    if (item)
    item.className='unhidden';
    </script>
    <div id="content"><!-- Top story -->
    <div id="topstory" class="box">
    <div id="topstory-img"></div>
    <!-- /topstory-img -->
    <div id="topstory-desc">
    <div id="topstory-title"><strong>BOOK Activity</strong></div>
    <!-- /topstory-title -->
    <div id="topstory-desc-in"></div>
    <!-- /topstory-desc-in --></div>
    <!-- /topstory-desc --></div>
    <!-- /topstory -->
    <div id="bodycontent">
    <% int errorCount=0; %>          
              <spring:bind path="bookactivityevent.*">
              <c:forEach items="${status.errorMessages}" var="error">
                        <B><font color="red">Error: <c:out value="${error}"/></font><B/>
                        <% errorCount++; %>
              </c:forEach>
              </spring:bind>
    <form method="post" name="bookingConflicts" action="<c:url value="/secure/bookActivityTrainer.htm"/>">
    <input type="hidden" name="bookingId"/>
    <input type="hidden" name="bookingDetailsId"/>
    <table align="left" width="50%" border=0>
    <tr>
    <td></td>
    <td>BookingType</td>
    <td>ClientName</td>
    <td>CourseTitle</td>
    <td>Duration</td>
    <tr>
    </tr>
    <tr>
    <c:forEach var="booking" items="${bookactivityevent.conflictBookings}" varStatus="a">
    <tr align="left">
              <td><INPUT TYPE="checkbox" NAME="booking" id="booking" value="<c:out value="${booking.bookingId}"/>" onClick="showBookingDays('<c:out value="${booking.bookingId}"/>')"></td>
              <td><c:out value="${booking.bookingType}"/></td>
              <td><c:out value="${booking.client.orgName}"/></td>
              <td><c:out value=""/></td>
              <td><c:out value="${booking.bookingId}"/></td>
         <c:set var="temp" value="${0}"/>
         <c:forEach var="bookingDetails" items="${booking.bookingDetails}">
         <tr align="right">
         <div align="left class="hidden" id="<c:out value="${booking.bookingId}"/>" >
         <td>
         <INPUT TYPE="RADIO" NAME="bookingDetails" id="<c:out value="${bookingDetails.bookingDetailsId}"/>" onClick="">Day<c:out value="${temp}"/>
         </td>
         <td>
         <c:out value="${bookingDetails.trainer.firstName}"/><c:out value="${bookingDetails.trainer.surName}"/>
         </td>
              <c:set var="temp" value="${temp+1}"/>
         </div>
         </tr>
              </c:forEach>
         </tr>
         </c:forEach>
    <tr>
              <td align="left" colspan="2"><input type="submit" name="_target0" value="Previous"/></td>
              <td align="left" colspan="2"><input type="submit" name="_target0" value="Amend"/></td>
              <td align="left" colspan="2"><input type="submit" name="_target2" value="Submit"/></td>
              <td align="left" colspan="2"><input type="submit" name="_target2" value="Rebook/Cancel"/></td>
         <td align="left" colspan="2"><input type="button" name="Cancel"
                   value="Cancel" onClick="goHomePage();"/></td>
         </tr>
    </table>
    </form>
    </div>
    <hr class="noscreen"/>
    <!-- /content -->
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
    <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
    <%@ page import='com.uk.nhs.training.data.ActivityMatrix'%>
    <%@ page import='com.uk.nhs.training.data.ActivityTimeConstants'%>
    <SCRIPT language="JavaScript" type="text/javascript">
    function bookActivity()
    if (document.bookActivityController.activitySelect.selectedIndex == 0)
    alert("Please Select Activity");
    else if (document.bookActivityController.trainerId.selectedIndex == 0)
    alert ( "Please Select Trainer");
    else if(document.bookActivityController.fromDate.value=="")
    alert("Please supply the Start Date of Activity")
    else
    validateForExistingCourses();
    function validateForExistingCourses()
    flag="wait";
    var trainerId=document.getElementById("trainerId").value;
    var fromDate=document.getElementById("fromDate").value;
    var toDate=document.getElementById("toDate").value;
    var activityId=document.getElementById("activitySelect").value;
    url="ajaxList.htm?actionType=checkBookedCoursesActivities&trainerId="+trainerId+"&fromDate="+fromDate+"&toDate="+toDate+"&activitySelect="+activityId;
    what = "checkForPreBookedCoursesActivities(req.responseXML)";
    doCallback(null);
    function checkForPreBookedCoursesActivities(theXmlResponse)
    // alert("in here in checking prebookedCourses");
    if(theXmlResponse != null)
         var isActivityExisting = theXmlResponse.getElementsByTagName('existingActivity')[0].text;
         var isCourseExisting = theXmlResponse.getElementsByTagName('existingbookedcourse')[0].text;     
              if(isActivityExisting=="Y")
              alert("Activity You are trying to book for Trainer already exists");
              return false;
              else if(isCourseExisting=="Y")
              if(confirm('Conflict Message. The dates choosen conflict with a current booking.Do you want to override'))
    window.open("/training1.1/secure/prebookedEvents.htm","clientwindow",'StatusBar', 'toolbar=yes,resizable=yes,scrollbars=yes,width=500,height=400,left=0,top=0');
    return false;
    else
    document.bookActivityController.action="/training1.1/secure/bookActivityTrainer.htm?actionType=submitForm";
    document.bookActivityController.submit();
    function goHomePage()
         window.location="/training1.1/secure/welcome.htm";
    function showHideAmPm(divId)
    if(document.bookActivityController.halfday.checked==true)
    showDiv(divId);
    else
    hideDiv(divId);
    function showDiv(divId)
    var item = document.getElementById(divId);
    alert("show item"+item);
    if (item)
    item.className='unhidden';
    function hideDiv(divId)
    var item = document.getElementById(divId);
    alert("unhide item"+item);
    if (item)
    item.className='hidden';
    function getActivitiesPm()
    if(document.bookActivityController.am.checked==true)
    document.bookActivityController.pm.checked=false;
    flag="wait";
         url="ajaxList.htm?actionType=activities&keyword=PM";
         what = "setActivities(req.responseXML)";
         doCallback(null);
         document.bookActivityController.activityTimeSelect.value="halfday";
         document.bookActivityController.activityTimeSubType.value="pm";
         // alert("subType"+document.bookActivityController.activityTimeSubType.value);
    function getActivitiesAm()
    if(document.bookActivityController.pm.checked==true)
    document.bookActivityController.am.checked=false;
    flag="wait";
         url="ajaxList.htm?actionType=activities&keyword=AM";
         what = "setActivities(req.responseXML)";
         doCallback(null);
         document.bookActivityController.activityTimeSelect.value="halfday";
         document.bookActivityController.activityTimeSubType.value="pm";
    function getSingleDayActivities()
    if(document.bookActivityController.singleday.checked==true)
    document.bookActivityController.moredays.checked=false;
    document.bookActivityController.halfday.checked=false;
    hideDiv('partofhalfday');
    document.bookActivityController.activityTimeSelect.value="fullday";
    flag="wait";
         url="ajaxList.htm?actionType=activities&keyword=FullDay";
         what = "setActivities(req.responseXML)";
         doCallback(null);
    else
    hideDiv('activitySelect');
    function getMoreDaysActivities()
    alert();
    if(document.bookActivityController.moredays.checked==true)
    document.bookActivityController.singleday.checked=false;
    document.bookActivityController.halfday.checked=false;
    hideDiv('partofhalfday');
    document.bookActivityController.activityTimeSelect.value="moredays";
    flag="wait";
         url="ajaxList.htm?actionType=activities&keyword=FullDay";
         what = "setActivities(req.responseXML)";
         doCallback(null);
    else
    hideDiv('activitySelect');
    showDiv('dateTo');
    function setActivities(theXmlResponse)
              //start filling the Venues Select boxes now
              if(theXmlResponse != null)
                   var coursesBox=document.getElementById("activitySelect");
                   coursesBox.options.length=0;
                   var activityElementsLength=theXmlResponse.getElementsByTagName('activity').length;     
                   var activityElementsArray=theXmlResponse.getElementsByTagName('activity');
                   //alert("length"+activityElementsLength+activityElementsArray);                              
              for(x = 0; x < activityElementsLength; x++)
                        //coursesBox.options[coursesBox.options.length] = new Option(coursesElementsArray[x].firstChild.text, coursesElementsArray[x].lastChild.text);
                        var optn = document.createElement("OPTION");
                   optn.text = activityElementsArray[x].firstChild.text;
    optn.value = activityElementsArray[x].lastChild.text;
    coursesBox.options.add(optn);
         if (activityElementsLength>0)
                   showDiv('activityTD');
              flag="release";
    </script>
    <div id="content"><!-- Top story -->
    <div id="topstory" class="box">
    <div id="topstory-img"></div>
    <!-- /topstory-img -->
    <div id="topstory-desc">
    <div id="topstory-title"><strong>BOOK Activity</strong></div>
    <!-- /topstory-title -->
    <div id="topstory-desc-in"></div>
    <!-- /topstory-desc-in --></div>
    <!-- /topstory-desc --></div>
    <!-- /topstory -->
    <div id="bodycontent">
    <% int errorCount=0; %>          
              <spring:bind path="bookactivityevent.*">
              <c:forEach items="${status.errorMessages}" var="error">
                        <B><font color="red">Error: <c:out value="${error}"/></font><B/><br/>
                        <% errorCount++; %>
              </c:forEach>
              </spring:bind>
    <form method="post" name="bookActivityController" action="<c:url value="/secure/bookActivityTrainer.htm"/>">
    <table align="right" width="50%" border=0>
    <input type="hidden" name="activityTimeSelect"/>
    <input type="hidden" name="activityTimeSubType"/>
    <tr>
    <td align="left">
    <spring:bind path="bookactivityevent.userSuppliedActivity.activity.time">
    <c:set var="activitytime" value="${bookactivityevent.userSuppliedActivity.activity.time}"/>
    <INPUT TYPE="checkbox" NAME="halfday" onclick="showHideAmPm('partofhalfday')" <c:if test="${(activitytime == 'AM')}"> checked</c:if>/>Half Day    
    <div align="left "id="partofhalfday"
    <c:choose>
    <c:when test="${(activitytime eq 'AM') || (activitytime eq 'PM')}"> </c:when>
    <c:otherwise> class="hidden"</c:otherwise>
    </c:choose>>
    <INPUT TYPE="RADIO" NAME="am" onClick="getActivitiesAm()" value="am" <c:if test="${(activitytime eq 'AM')}"> checked </c:if> >AM <INPUT TYPE="RADIO" NAME="pm" onClick="getActivitiesPm()" <c:if test="${(activitytime eq 'PM')}"> checked </c:if>>PM <BR>
    </div>
    </td>
    </tr>
    <tr>
    <td><INPUT TYPE="checkbox" NAME="singleday" onClick="getSingleDayActivities()" <c:if test="${activitytime eq 'FULLDAY'}"> checked </c:if>> Single Day</td>
    </tr>
    <tr>
    <td><INPUT TYPE="checkbox" NAME="moredays" onClick="getMoreDaysActivities()" <c:if test="${activitytime eq 'MOREDAYS'}"> checked </c:if>> More Days</td>
    </tr>
    </spring:bind>
    <tr>
              <td align="left" id="activityTD">Activity :
              <c:set var="activityList" value="${requestScope.activityMap}"/>
         <c:choose>
                        <c:when test="${empty activityList}">
                        <spring:bind path="bookactivityevent.userSuppliedActivity.activity.activityId">
              <select name="activitySelect" id="activitySelect" size="1"
                   STYLE="width: 150px">
                   <option value="Choose Activity" default>Choose Activity</option>
              </select>
              </spring:bind>
              </c:when>
              <c:otherwise>      
              <spring:bind path="bookactivityevent.userSuppliedActivity.activity.activityId">
              <select name="activitySelect" id="activitySelect"
                   size="1" STYLE="width: 150px">
                   <option value="" default>Choose Activity</option>
                   <c:forEach var="activity" items="${activityList}" varStatus="a">
                        <c:choose>
                             <c:when
                                  test="${(bookactivityevent !=null) && (bookactivityevent.userSuppliedActivity.activity.activityId == activity.activityId)}">
                                  <option value="<c:out value="${activity.activityId}"/>" selected><c:out
                                       value="${activity.activityId}" /></option>
                             </c:when>
                             <c:otherwise>
                             <option value="<c:out value="${activity.activityId}"/>"><c:out
                                       value="${activity.activity}"/>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>
         </spring:bind>
         </c:otherwise>
         </c:choose>
         </td>
    </tr>
         <tr>
              <td align="left">Trainer:
              <spring:bind path="bookactivityevent.userSuppliedActivity.trainer.trainerId">
              <select name="trainerId" id="trainerId"
                   size="1" STYLE="width: 150px">
                   <option value="" default>Choose Trainer</option>
                   <c:forEach var="trainer" items="${trainers}" varStatus="a">
                        <c:choose>
                             <c:when
                                  test="${(bookactivityevent !=null) && (bookactivityevent.userSuppliedActivity.trainer.trainerId == trainer.trainerId)}">
                                  <option value="<c:out value="${trainer.trainerId}"/>" selected>
                                  <c:out value="${trainer.firstName}"/>&nbsp<c:out
                                       value="${trainer.surName}" /></option>
                             </c:when>
                             <c:otherwise>
                                  <option value="<c:out value="${trainer.trainerId}"/>"><c:out
                                       value="${trainer.firstName}"/>&nbsp<c:out
                                       value="${trainer.surName}" /></option>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>
         </spring:bind>     
              </td>
         </tr>
         <tr>
              <td align="left" id="dateFrom">From Date
              <spring:bind path="bookactivityevent.userSuppliedActivity.dateFrom">
              <fmt:formatDate var="formattedFromDate" type="date" pattern="dd/MM/yyyy" value="${status.value}"/>
              <input type="text" name="dateFrom" value="<c:out value='${formattedFromDate}'/>"/>
              </spring:bind>
              <a href="javascript:cal1.popup();"><img
                   src="../design/cal.gif" width="16" height="16" border="0"
                   alt="Click Here to Pick up the date"></a></td>
         </tr>
         <tr>
              <td align="left" id="dateTo" class="hidden">To Date
              <spring:bind path="bookactivityevent.userSuppliedActivity.dateTo">
              <fmt:formatDate var="formattedToDate" type="date" pattern="dd/MM/yyyy" value="${status.value}"/>
              <input type="text" name="dateTo" value="<c:out value='${formattedToDate}'/>"/>
              </spring:bind>
              <a href="javascript:cal2.popup();"><img
                   src="../design/cal.gif" width="16" height="16" border="0"
                   alt="Click Here to Pick up the date"></a></td>
         </tr>
         <tr>
              <td align="left" colspan="2"><input type="submit" name="_target2" value="BookActivity"/></td>
                   <c:if test="${(bookactivityevent != null) && (not empty bookactivityevent.conflictBookings)}">
    <td align="left" colspan="2"><input type="submit" name="_target1" value="OverRideBookings"/></td>
    </c:if>
              <td align="left" colspan="2"><input type="button" name="Cancel"
                   value="Cancel" onClick="goHomePage();" /></td>
         </tr>
    </table>
    </form>
    </div>
    <hr class="noscreen"/>
    <div class="content-padding"></div>
    <script language="JavaScript">
         var cal1 = new calendar1(document.bookActivityController.elements['dateFrom']);
         cal1.year_scroll = true;
         cal1.time_comp = false;
    var cal2 = new calendar1(document.bookActivityController.elements['dateTo']);
         cal2.year_scroll = true;
         cal2.time_comp = false;
    </script></div>
    <!-- /content -->
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
    <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
    <%@ page isELIgnored="false" %>
    <%@ page import="java.util.List" %>
    <%@ page import="com.uk.nhs.training.data.BookingDetails" %>
    <div id="content">
    <!-- Top story -->
    <div id="topstory" class="box">
    <div id="topstory-img"></div> <!-- /topstory-img -->
    <div id="topstory-desc">
    <div id="topstory-title">
              <strong>BOOK COURSE (CONT..)</strong>
    </div> <!-- /topstory-title -->
    <div id="topstory-desc-in">
    </div> <!-- /topstory-desc-in -->
    </div> <!-- /topstory-desc -->
    </div> <!-- /topstory -->
    <div>
    <SCRIPT language="JavaScript" type="text/javascript">
    function setEndDate()
         var i=0;
         for (var j = 0; j < document.forms[0].elements.length; j++) {
              if (document.forms[0].elements[j].type == 'text')i++;
         for (var k = 0; k < i; k++) {     
              document.getElementById("hhh"+k).value=document.getElementById("bbb"+k).value;
    function free_date_picker(obj_name, layer_name, text_to ,type, hide_self, language, row_id, coursetime)
    // IF str < lng, add leading 0 to complete the str
    function leading_zeros(str, lng)
    // param validation
    if(lng == null)
    lng = 2;
    var str = str.toString();
    while(str.length < lng)
    str = '0' + str;
    return str;
    // Nbr days for this month
    function returnDays(date)
    var year = date.getFullYear();
    var month = date.getMonth();
    var days = 31;
    if( month == 3 || month == 5 || month == 8 || month == 10 ){
    days = 30;
    else if(month == 1){
    days = 28;
    if(year % 4 == 0){
    days = 29;
    if(year % 100 == 0){
    days = 28;
    if(year % 400 == 0){
    days = 29;
    return(days);
    // Return last month
    function returnLastMonth(date)
    var year = date.getFullYear();
    var month = date.getMonth();
    var dt = new Date();
    month --;
    if(month == -1){
    month = 11;
    year --;
    dt.setYear(year);
    dt.setDate(1);
    dt.setMonth(month);
    return dt;
    // Retourne le mois suivant
    function returnNextMonth(date)
    var year = date.getFullYear();
    var month = date.getMonth();
    var dt = new Date();
    month ++;
    if(month == 12){
    month = 0;
    year ++;
    dt.setYear(year);
    dt.setDate(1);
    dt.setMonth(month);
    return dt;
    // Retourne le nom du mois
    function return_month_name(date)
    switch(language){
    case("en"):
    var month = new Array('January', 'February', 'March', 'April', 'May', 'June',
    'July', 'August', 'September', 'October', 'November', 'December');
    break;
    case("fr"):
    default:
    var month = new Array('Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
    'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre');
    return month[date.getMonth()];
    function return_month_in_letters(themonth)
    switch(language){
    case("en"):
    var month = new Array('January', 'February', 'March', 'April', 'May', 'June',
    'July', 'August', 'September', 'October', 'November', 'December');
    break;
    case("fr"):
    default:
    var month = new Array('Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
    'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre');
    return month[themonth];
    this.setto = function(eng_date)
    // input text
    if(type == 1)
    document.getElementById(text_to).value = eng_date;
    // span, div ...
    if(type == 2)
    document.getElementById(text_to).innerHTML = eng_date;
    this.write_calendar = function(date)
    var monDate;
    var nb_days_last_month = 0;
    var cnt_days = 0;
    var days_month = 0;
    var str = new String();
    var style = new String();
    var next_month = new Date();
    var last_month = new Date();
    var today = new Date();
    var date = new Date(date);
    var last_year = new Date(date);
    var next_year = new Date(date);
    date.setDate(1); // le premier du mois
    next_month = returnNextMonth(date); // le mois précédent
    last_month = returnLastMonth(date); // le mois suivant
    nb_days_last_month = returnDays(last_month); // nombre jours mois précédent
    cnt_days = -date.getDay()+1; // compteur de jours, part le dimanche du début du mois
    days_month = returnDays(date); // nombre de jours mois sélectionné
    str = ''; // forge la chaîne de caractères à mettre dans la div
    next_year.setYear(date.getFullYear() + 1); // année précédente
    last_year.setYear(date.getFullYear() - 1); // année suivante
    str += '<table cellspacing="0" cellpadding="0" border="1" width="250" bgcolor="blue">';
    str += '<tr>';
    // année précédente
    str += ' <td colspan="1" align="left"><a href="' + "javascript:" +
    obj_name + ".write_calendar('" + eval(last_year) + "')" + ';"><--</a></td>';
    // mois précédent
    str += ' <td colspan="1" align="left"><a href="' + "javascript:" +
    obj_name + ".write_calendar('" + eval(last_month) + "')" + '"><-</a></td>';
    // libellé mois année
    str += ' <td colspan="3" align="center">'
    str += return_month_name(date) + ' ' + date.getFullYear();
    str += ' </td>';
    // mois suivant
    str += ' <td colspan="1" align="right"><a href="' + "javascript:" +
    obj_name + ".write_calendar('" + eval(next_month) + "')" + '">-></a></td>';
    // année suivante
    str += ' <td colspan="1" align="right"><a href="' + "javascript:" +
    obj_name + ".write_calendar('" + eval(next_year) + "')" + '">--></a></td>';
    str += '</tr>';
    // pour tous les jours du mois
    var cnt_semaines = 0;
    while(cnt_semaines < 6){
    cnt_semaines ++;
    str += ' <tr>';
    for(var cnt = 0; cnt < 7; cnt++){
    // mois suivant
    if(cnt_days > days_month){
    day = cnt_days - days_month;
    month = next_month.getMonth() + 1;
    year = next_month.getFullYear();
    style = "font-size:10px;";
    // mois précédent
    else if(cnt_days < 1){
    day = cnt_days + nb_days_last_month;
    month = last_month.getMonth() + 1;
    year = last_month.getFullYear();
    style = "font-size:10px;";
    // mous sélectionné
    else{
    var d1 = new Date();
    var d2 = new Date();
    // Todays date for comparision.
              var today=new Date();     
    d1.setMonth(date.getMonth());
    d1.setYear(date.getFullYear());
    d1.setDate(cnt_days);
    day = cnt_days;
    month = date.getMonth() + 1;
    year = date.getFullYear();
    // aujourd'hui ?
    if(d1.getFullYear() == d2.getFullYear() && d1.getMonth() == d2.getMonth() && d1.getDate() == d2.getDate() ){
    style = "font-size:18px;font-color:red;";
    else{
    style = "font-size:12px;";
    //dstr = year + '/' + leading_zeros(month) + '/' + leading_zeros(day);
              dstr=leading_zeros(day) + ' ' + return_month_in_letters(month-1) + ' ' + year;
              if (cnt==1) monDate=dstr;
    // inscrit la cellule
    str += ' <td width="14%">';
    str += ' <span style="' + style + '">';
    if (month < (today.getMonth()+1) || (year < today.getFullYear()) ) {
    str += '<font color="darkblue">';
    str += day;
    str += '</font>';
    } else if ((cnt>=1)&& (cnt<=5) && (month == (today.getMonth()+1)) && (day > today.getDate())) {
    str += ' <a href="javascript:' + obj_name + '.setto(\'' + dstr + '\')" onClick="getWeekCalendarViewTrainer(\''+monDate+'\', \''+row_id+'\', \''+coursetime+'\', \''+dstr+'\')">';
    str += day;
    str += ' </a>';
    } else if ( ((cnt>=1)&& (cnt<=5) && (month > (today.getMonth()+1))) || ( (cnt>=1)&& (cnt<=5) && (year > today.getFullYear()) ) ) {
    str += ' <a href="javascript:' + obj_name + '.setto(\'' + dstr + '\')" onClick="getWeekCalendarViewTrainer(\''+monDate+'\', \''+row_id+'\', \''+coursetime+'\', \''+dstr+'\')">';
    str += day;
    str += ' </a>';
    }else {
    str += '<font color="darkblue">';
    str += day;
    str += '</font>';
    str += ' </font>';
    str += ' </td>';
    cnt_days ++;
    str += ' </tr>';
    str += '</table>';
    document.getElementById(layer_name).innerHTML = str;
    this.show = function()
    if(hide_self)
    document.getElementById(layer_name).style.visibility = 'visible';
    this.hide = function()
    if(hide_self)
    document.getElementById(layer_name).style.visibility = 'hidden';
    // create layer and show calendar
    document.write('<div id="' + layer_name + '" onmouseout="' + obj_name + '.hide();">...</div>');
    this.write_calendar(new Date());
    </SCRIPT>
    <form name="BookType2" action="<c:url value="/secure/bookCourse.htm"/>" method="post" onsubmit="javascript:setEndDate()">
         <%int errorCount=0; %>
         <spring:bind path="booking.*">
         <c:forEach items="${status.errorMessages}" var="error">
                   <B><font color="red">Error: <c:out value="${error}"/></font><B/><br/>
                   <% errorCount++; %>
         </c:forEach>
         </spring:bind>
         <% if (errorCount == 0) { %>
         <table width="960">
              <%int i=0; %>
              <c:forEach items="${booking.bookingDetails}" var="q" varStatus="rowStatus">
              <tr><td colspan="3">Pick a Date from the Date Picker for Course:          
                   <strong> <c:out value="${q.course.courseTitle}"/></strong></td></tr>
              <tr><td>
              <%String theCourseTime=((BookingDetails)pageContext.getAttribute("q")).getCourse().getCoursetime();%>
              <script>var b<%=i %> = new free_date_picker('b<%=i %>', 'date_picker_b<%=i %>', 'bbb<%=i %>', 1, false, 'en', '<%=i %>', '<%=theCourseTime%>');</script>
              </td><td>
              <spring:bind path="booking.bookingDetails['${rowStatus.index}'].startDate">
              <input name="bookingDetails[<%=i %>].startDate" id="bbb<%=i %>" type="text" size="17" readOnly="true" value="<c:out value="${status.value}"/>" />
              </spring:bind>
              <spring:bind path="booking.bookingDetails['${rowStatus.index}'].endDate">
              <input name="bookingDetails[<%=i %>].endDate" id="hhh<%=i %>" type="hidden" value="<c:out value="${status.value}"/>" />
              </spring:bind>
              <br/><br/>
              <c:if test="${q.trainer.trainerId == null}">
              <spring:bind path="booking.bookingDetails['${rowStatus.index}'].trainer.trainerId">
              <select name="bookingDetails[<%=i %>].trainer.trainerId" id="trainerValue<%=i %>">
              <option value="">Select trainer</option>
              </select>
              </spring:bind>
              </c:if>
              <c:if test="${q.trainer.trainerId != null}">
              <spring:bind path="booking.bookingDetails['${rowStatus.index}'].trainer.trainerId">
              <select name="bookingDetails[<%=i %>].trainer.trainerId" id="trainerValue<%=i %>">
              <option value="<c:out value="${status.value}"/>" selected><c:out value="${q.trainer.title} ${q.train                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

    The slightest mistake in a javascript function will cause JSP to have problems and Javascript will not tell you what the
    problem is. Example, if you are missing a ';' it will not tell you where the problem is.
    Its best to comment out all contents of all the javascript functions and run your JSP. If displays ok, then uncomment
    out one function at a time and try running the JSP again. Keep doing this until you come across the one or more
    functions that have a problem and fix them.
    One problem I think I found is this:
    FROM
    for(i=0;i<=bookings.length;i++)
    TO:
    for(var i=0;i<=bookings.length;i++)
    If you comment out the javascript and it still doesnt compile, comment out blocks of the html tags, then uncomment one section at a time to see where the problem is. Alternatively, install an IDE such as Eclipse. Its JSP editor will often highlight where there is a problem in the html tags (but not in the javascript)

  • External casts not using relative paths when  protect movie

    We make educational software using Director - the basic form
    of the software is a stub movie projector with a load of protected
    movies in a series of folders and sub folders - shared resources
    are located in external casts within the folder hierarchy but not
    necessarily within the same folder as the movie - this has worked
    fine for ages. Navigation between movies is working fine, but..
    ..some of the movies are looking for external casts at their
    original locations (absolute paths) rather than relative to the
    movie file, so I can't port the project to another computer/
    release the software without getting the error messages. Even when
    I recreate the movies from scratch and link up the external casts,
    I am getting the same result, almost as if the dir to dxr process
    is not switching the movies from absolute paths to relative
    paths..??
    Any ideas appreciated!
    Tom

    Hi,
    If I understand the problem correctly, I see two ways of going forward:
    1. Hard code the entire URL.
    2. Calculate the correct URL with JavaScript.  I have a JS function for that on: http://www.wvanweelden.eu/blog/2012/08/03/get-relative-link-project-root
    Greet,
    Willam

  • JSP variable in javascript

    Can I use a jsp variable in javascript? If so, how? It would be used in an "if" statement:
    function get This() {
    if (document.form.tfName.checked==true) || (<%jsp>) {
      then do this...}
    }

    My problem is I am grabbing a persistant value from a
    value object: the value of a checkbox as
    <%=InformationVO.isChecked()%>If (==true) i want javascript to enable a button on
    load. If not disable it. Plus I hav javascript on
    the page that controls this while the page is open.
    Just don't know how to incorporate the two scenarios
    s for:
    1.checking the value to ernable/disable the sumbit on
    load with the value of the VO
    2. using javascript to control the enable/disable
    while page is laodedYou want something like this?
    <%
    boolean enableButton = InformationVO.isChecked();
    %>
    <html>
    <head>
    <script language="javascript">
    // load event, enables or displables button depending on the InformationVO.isChecked value.
    function doMyLoadEvent(){
         if(<%=enableButton%>){
              // enable mySubmitButton object
         }else{
              // disable mySubmitButton object
    // submits the form
    function submitForm(){
         var frm = document.forms[0];
           frm.action = "path to your servlet goes here";
           frm.submit();     
    </script>
    </head>
    <body onload="javascript:doMyLoadEvent()">
    Woopdy doo!
    <form method="post" action="" name="">
    <input type="button" name="mySubmitButton" value="Submit" onclick="javascript:submitForm()">
    </form>
    </body>
    </html>

  • JSP Linking in javascript

    Hi,
    I have downloaded the masthead portal archive and imported it into my NDS. I have added a couple of extra jsps and a javascript file. What I'm trying to do is have a popup window launch from my first jsp to hold my 2nd jsp via javascript. e.g.
    The javascript calls: window.open("FFDialog.jsp","Dialog","width:200px;height:100px;toolbar:no;directories:no;status:no;menubar:no;scrollbars:no;resizable:no;modal:yes");
    The popup opens, but doesn't contain my jsp (which is really just a basic html/js file).
    I think its because my jsp sits under dist->PORTAL-INF->jsp and the javascript under dist->scripts hence FFDialog.jsp isn't in the same location. What needs to be the path in my window.open?
    Cheers!

    Hi Jo,
             In your jsp ,from where you are calling javascript function to call other jsp, write below code
             to get the app path.
    <%String webpath = componentRequest.getWebResourcePath()+"/"; %>
            Now the variable have the root path for your application , So suppose your 2nd jsp page is
    inside a director called jsp so now you use:-
    window.open("<%=webpath%>jsp/FFDialog.jsp", "Dialog","width:200px;height:100px;
    toolbar:no;directories:no;status:no;menubar:no;scrollbars:no;resizable:no;modal:yes");
           Same way if you have your css file inside a directory called css use below code:-
    <LINK href="<%=webpath%>css/style1.css" type=text/css rel=stylesheet>
        Regards,
        Piyush

  • I tried to rename a file, it gave me an error message (can't remember the number - 43??) and then the file disappeared from the original folder. When I do a search, the file comes up under the new name, but it does not show a path, and even though preview

    I tried to rename a file, it gave me an error message (can't remember the number - 43??) and then the file disappeared from the original folder. When I do a search, the file comes up under the new name, but it does not show a path, and even though preview shows the contents, I can't open the document (Powerpoint) and I can't move the document. I tried "Copy" and paste but it doesn't work. I tried "Share" with Airdrop and iChat, but the file is inaccessible. When i try to rename the file, it says the filename is too long.
    When I try to open it, it says the alias is not good, and asks if I want to fix the alias. I'm afraid to do that and lose all access to this document.
    Right now, it feels like a ghost document - it is on the computer intact, but it is in an undisclosed location and inaccessible.
    Please help!!

    I was able to resolve this by repairing permissions, even though no permissions error was listed specifically for that file.
    I could also have recovered it through Time Machine, but I'm interested in knowing how not to have this happen again!
    I was afraid of rebooting and possibly losing track even of the ghost.
    I did not try EasyFind - I'll keep that in mind next time.
    Thanks for all the comments.

  • Passing jsp variable into javascript.....

    Hai friends,
    Look this code.....
    var mywindow= window.open( ......)
    mywindow.<%= loc%>.style.visibility = "hidden";     
    loc is my jsp variable passing dyanamically to the script....
    But it is not taking....
    when i assign jsp var into javascript like
    mywindow.somehardcodedvalue.style.visibility = <%= loc%>;     
    it is working fine ....
    pl reply me.......

    Hi,
    It is not working.My code is like....
    String loc=(String)arrStr;
    %>
    <script language="JavaScript" type="text/JavaScript">
    mywindow.<%= loc%>.style.visibility = "hidden";     
    </script>
    <%

  • Error 10 Could not locate resource

    I tried to auto download the JRE using the JREInstaller and the DownloadServlet (sample in jdk 1.5) from a local server. I got the error 10 Could not locate resource.
    <j2se version="1.5.0*"  href="http://127.0.0.1:8080/Web-Test2/install/javaws-1_0_1-j2re-1_5_0-windows-i586.jnlp"/>If I only take <j2se version="1.5.0*"  href="http://127.0.0.1:8080/Web-Test2/install"/>, I will get an error: "Missing version field in response from server when accessing resource"
    Any idea?

    The request made by java web start to download the jre is a using the extension protocol (version protocol) see the jnlp spec at:
    http://jcp.org/aboutJava/communityprocess/mrel/jsr056/index.html
    basically what this means is that you need to be running a servlet or jsp page on the target that implements the version protocol. see:
    http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/downloadservletguide.html
    I don''t know what you have at the target address of the jre:
    javaws-1_0_1-j2re-1_5_0-windows-i586.jnlp
    but you need servlet running at http://127.0.0.1:8080/Web-Test2/install to implement the version protocol.
    /Andy

  • Gcc not found in path

    Hi, whenever i open this project, there's always this error, anybody knows how i can get rid of it? I have MinGw installed and path-ed already.

    Your English is far easier to understand than native speakers who assume a huge amount of knowledge.
    I have followed your steps, but i have the following problems:
    Problem pane:
    Description Resource Path Location Type
    Program "g++" not found in PATH Preferences, C++/Build/Settings/Discovery, [CDT GCC Built-in Compiler Settings] options C/C++ Scanner Discovery Problem
    Program "gcc" not found in PATH Preferences, C++/Build/Settings/Discovery, [CDT GCC Built-in Compiler Settings] options C/C++ Scanner Discovery Problem
    undefined reference to `WinMain' [project name] line 0, external location: C:\MinGW\x86_64-w64-mingw32\lib\libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c C/C++ Problem
    A little red X symbol on the project in the Project explorer
    When i choose Run/Run or Run/Debug, I get the error "Launching [project name].exe has encountered a problem., Program file does not exist.
    Indeed the file does not exist at that location, and I have no idea how to put it there. Can anyone help please?
    Thanks

  • Address bar should not show form path

    i have deployed application server 6i. When i login on some form through web.The login form path also displays on address bar. I want that address bar should not display on top either or not display form path.Do i have to configure application server for that or some other . Please give me solution

    What do you mean by the login form path.
    Could you perhaps post an example of the URL and indicate which part of the URL worries you? Or is it the fact that the URL itself is displayed? If it's the latter, then you will have to open the browser window from a link using a little bit of javascript to open a new window without address bar (and perhaps menu bar, status bar, etc). Just google for "javascript new window popup"

Maybe you are looking for

  • Version of awk in Solaris 10?

    I have found that there are /usr/bin/awk (hard linked with /bin/awk) /usr/bin/nawk (hard linked with /bin/nawk) /usr/bin/oawk (hard linked with /bin/oawk) What are they? I wanna ask what version of awk does Solaris 10 use?

  • Photoshop Elements 6.0 will not print in color

    Why has my PSE6 stopped printing in color?   I have Vista and  I cannot locate the preference files to rename as suggested:  Users\[user]\AppData\Roaming\Adobe\PhotoshoopElements\6.0\Organizer\psa.prf   to........\psa.old . Help

  • My springboard crashed moving from old 3Gs to new (but used) 4.  Now what??

    I recently got a new phone from my new work- the iphone 4. It was previously owned by a co-worker and still had all his info on the phone. I activated it with at&t but didn't have my old phone for them to do a data transfer/backup. They gave instruct

  • IPhoto 9.4.2, photo stream-add subscriber?

    Hello I cannot figure out how to create a list of subscribers to share my Photo Stream pics. I succeeded in adding photos and have a Photo Stream icon in the Source panel, which shows my chosen photos, but not what? How do I notify someone or add a s

  • Itunes crash

    Problem signature:   Problem Event Name:          BEX   Application Name:          iTunes.exe   Application Version:          11.1.1.11   Application Timestamp:          524a8521   Fault Module Name:          StackHash_0a9e   Fault Module Version: