Can JSTL tags be used within scriptlet code?

This may be a very basic question, I have only just started experimenting with JSTL in JSPs.
I am trying to let the user save the content of the OutputStream to a file, and that works with the following code:
<%
String file_out = request.getParameter("file_content");
out.write(file_out);
response.setContentType("application/x-download");
response.setHeader("Content-Disposition","attachment;filename=�ble�en.txt"); %>Both Firefox and IE display a dialog that lets the user save as a file, and I can use characters from any character set as the file name (JSPs are all in UTF8).
I would like to pull the suggested file name from a resource bundle instead of fhardcoding it, however, so that I can display an appropriate suggestion for various languages. I can't figure out how to use a JSTL formatting tag for the file name with the scriptlet code, however, without getting a compilation error:
<fmt:message key="file_save_as" />
I can display localized messages just fine, as long as I don't try to do it within scriptlet code. I have tried to split the scriptlet code above, with the JSTL tag in between, but I can't find a way that works. Any pointers would be appreciated.

am trying to let the user save the content of the OutputStream to a fileThis is something better done in a servlet than a JSP.
A jsp can add extra carriage returns into your output stream, which might corrupt your data.
I can't figure out how to use a JSTL formatting tag No, you can't mix scriptlet code and tag code.
The JSTL tags are written for JSPs to eliminate scriptlet code from the page. If you are doing this in scriptlet code anyway, I suggest you use the ResourceBundle classes as you normally would in java code. Thats what the fmt:message tag is doing behind the scenes anyway.
ResourceBundle bundle = ResourceBundle.getBundle("myApp.properties");
String filename = bundle.getString("file_save_as");Cheers,
evnafets

Similar Messages

  • How can i edit registry using a java code

    hi
    i want to configure internet explorer settings using java code.one way to configure is to edit registry iteslf (correct me if i am wrong).
    now please tell me if there is any way to edit registry using java code.
    thanks and advance
    shwetank

    If you don't want to write the code yourself, check here:
    http://cogentlogic.com/cocoon/CogentLogicCorporation/Home.xml

  • How do I debug scriptlet code?

    Hi,
    My code crashes everytime I submit to the page below which as you can tell is a mix of scriptlet code and html (not the best design but that's what I inherited). When I put a breakpoint where it says [breakpoint] (for illustrative purposes), save the file and run the app (it's a JSF webapp) in 10.1.3 debugger, the breakpoint is never hit even though the code is undoubtedly being executed. Any ideas on why this is?
    Thanks
    <%@ page import="java.sql.*,java.util.*" errorPage="error.jsp"  %>
    <%@ page import="com.cde.fedapp.EmpStatus.*,com.cde.fedapp.PrincipalLevel.*"%>
    <%@ page import="com.cde.fedapp.common.*,com.cde.fedapp.contract.*"%>
    <%@ page import="com.cde.fedapp.TeachSub.*,com.cde.fedapp.AdminArea.*"%>
    <%@ page import="com.cde.fedapp.District.*,com.cde.fedapp.JobClassl.*"%>
    <jsp:useBean id="user" class="com.uisecurity.User" scope="session"/>
    <jsp:useBean id="staff" class="com.cde.fedapp.staff.StaffVO" scope="request"/>
    <jsp:useBean id="ods" class="oracle.jdbc.pool.OracleDataSource" scope="application" />
    <jsp:useBean id="staffHelper" class="com.cde.fedapp.staff.StaffHelper" scope="session"/>
    <!-- addStaffRecord.jsp -->
    <%--=============================================================================
    --               Fed App - Add Staff Page
    -- Type:         Dynamic Java Server Pages (JSP) Document
    -- Name:         addStaffRecord.jsp
    -- Installation: Colorado Department of Education (CDE) - IMS      
    -- Author:       Eldirdiri Abueldahab (Dee)
    -- Date:         September 5, 2007
    -- Summary:      This is the add staff page. FedApp application is implementing the
                     Composite View Pattern. Each page has a menu, header and footer.
                     Refere to http://java.sun.com/blueprints/patterns/CompositeView.html
    =============================================================================--%>
    <%
    [breakpoint]
      String fn = user.getFullName();
      String role = user.getRole();
      String agencyCode = user.getAgencyCode();
      String partbApprovalInd = user.getPARTB_APPROVAL_IND();
      String prescApprovalInd = user.getPRESC_APPROVAL_IND();
      if(fn == null ){
    %>
        <jsp:forward page="login.jsp" /><%}
    %>
    <%
      Connection conn = null;
      Page mypage = null;
      Page Principalpage=null;
      Page EmpStatuspage=null;
      Page Districtpage=null;
      Page Distpage=null;
      Page JobClasspage= null;
      Page TeachSubpage= null;
      Page AdminAreapage = null;
      Principalpage = staffHelper.getCurrentPrincipalpage();
      EmpStatuspage = staffHelper.getCurrentEmpStatuspage();
      Districtpage  = staffHelper.getCurrentExistingDistrictPage();
      Distpage      = staffHelper.getCurrentExistingDistPage();
      JobClasspage  = staffHelper.getCurrentJobClasspage();
      TeachSubpage  = staffHelper.getCurrentTeachSubpage();
      AdminAreapage = staffHelper.getCurrentAdminAreapage();
      String myTitle  = "Add End User Devices";
      String infoMessage = request.getParameter("infoMessage");
      String alertMessage = infoMessage;
      if(null==infoMessage){
        infoMessage = "";
      String m_ssn = null;
      String m_fname = null;
      String m_mname = null;
      String m_lname = null;
      String m_dist = null;
      String m_sal = null;
      String m_ben = null;
      String m_fte = null;
      String m_begmn = null;
      String m_endmn = null;
      String m_job = null;
      String m_sub = null;
      String m_adm = null;
      String m_princ = null;
      String m_stat = null;
      String contractInd = request.getParameter("contractInd");
      String holdValues = request.getParameter("holdValues");
       if(contractInd != null || holdValues != null){
      m_fname = request.getParameter("fname");
      m_mname = request.getParameter("mname");
      m_lname = request.getParameter("lname");
      m_dist = request.getParameter("dist");
      m_sal = request.getParameter("sal");
      m_ben = request.getParameter("ben");
      m_fte = request.getParameter("fte");
      m_begmn = request.getParameter("begmn");
      m_endmn = request.getParameter("endmn");
      m_job = request.getParameter("job");
      m_sub = request.getParameter("sub");
      m_adm = request.getParameter("adm");
      m_princ = request.getParameter("princ");
      m_stat = request.getParameter("stat");
      m_ssn = request.getParameter("ssn");
      if (m_ssn == null) m_ssn = "";
      if (m_fname == null) m_fname = "";
      if (m_mname == null) m_mname = "";
      if (m_lname == null) m_lname = "";
      if (m_dist == null) m_dist = "";
      if (m_sal == null) m_sal = "";
      if (m_ben == null) m_ben = "";
      if (m_fte == null) m_fte = "";
      if (m_begmn == null) m_begmn= "";
      if (m_endmn == null) m_endmn = "";
      if (m_job == null) m_job = "";
      if (m_sub == null) m_sub = "";
      if (m_adm == null) m_adm = "";
      if (m_princ == null) m_princ = "";
      if (m_stat == null) m_stat = "";
      if (contractInd== null) {
        m_stat = "";
        //.contractInd = "";
       boolean viewOnly = false;
       if(staff.getFundCode().equals("4027") && partbApprovalInd.equals("Y")) viewOnly = true;
       if(staff.getFundCode().equals("4173") && prescApprovalInd.equals("Y")) viewOnly = true;
    %>
    <html>
    <head><title>Fed App - Adding New Staff Records</title>
    <link href="edstyle.css" rel="stylesheet" type="text/css">
    </head>
    <body onload="sf()">
    <SCRIPT LANGUAGE="JavaScript1.1" SRC="script/FormChek.js"></SCRIPT>
    <SCRIPT LANGUAGE="javascript">
    <!--
    function sf() {
    document.staffAdd.ssn.focus();
    function ssnfoc(){
    window.status = "Social Security Number is a unique number assigned to individual. It must be numeric (9 digits, no hyphens)."
    function fnamefoc(){
    window.status = "First Name is a name given to an individual at birth, baptism, or during another naming cermony, or through legal change."
    function mnamefoc(){
    window.status = "Middle Name is a secondary name given to an individual at birth, baptism, or during another naming cermony, or through legal change."
    function lnamefoc(){
    window.status = "Last Name is the name borne in common by members of a family."
    function distfoc(){
    window.status = "District/BOCES name is a unique name."
    function subfoc(){
    window.status = "Teaching Subject Area is a description of an area course for which an individual has the responsibilty to teach or to assist a teacher."
    function jobfoc(){
    window.status = "Job Classification is a description of the specific group of duties and responsibilities of a job classification."
    function admfoc(){
    window.status = "Administrator/Instructional Area is a description of the system outlining instructional or non-instructional activities."
    function ftefoc(){
    window.status = "For each person employed, report the total FTE for his/her special education assignment."
    function salfoc(){
    window.status = "For each person employed, report the total salary (excluding benefits) for his/her special education assignment."
    function benfoc(){
    window.status = "Enter the appropriat amount if the administrative unit uses federal funds to pay for benefits for this staff person."
    function begmnthfoc(){
    window.status = "Please report the beginning month the employee will be paid for services performed during school year."
    function endmnthfoc(){
    window.status = "Please report the ending month the employee will be paid for services performed during school year."
    function princfoc(){
    window.status = "Report the appropriate level of the person's assignment."
    function statfoc(){
    window.status = ""
    function buttonClick(){
    if(document.staffAdd.ssn.value=="") {
    alert("Please Enter Social Security Number!");
    document.staffAdd.ssn.focus();
    return false; }else if(document.staffAdd.fname.value==""){
    alert("Please Enter First Name!");
    document.staffAdd.fname.focus();
    return false; }else if(document.staffAdd.lname.value==""){
    alert("Please Enter Last Name!");
    document.staffAdd.lname.focus();
    return false; }else if(document.staffAdd.dist.value==""){
    alert("Please Select District/BOCES!");
    document.staffAdd.dist.focus();
    return false; }else if((document.staffAdd.fte.value=="") && (document.staffAdd.sal.value!="")){
    alert("Please Enter FTE!");
    document.staffAdd.fte.focus();
    return false; }else if((document.staffAdd.fte.value!="") && (document.staffAdd.sal.value=="")){
    alert("FTE must be blank if salary is blank!");
    document.staffAdd.fte.focus();
    return false; }else if(document.staffAdd.begmn.value==""){
    alert("Please Select Begining Month!");
    document.staffAdd.begmn.focus();
    return false; }else if(document.staffAdd.endmn.value==""){
    alert("Please Select Ending Month!");
    document.staffAdd.endmn.focus();
    return false; }else if(document.staffAdd.job.value==""){
    alert("Please Enter Job Class Code!");
    document.staffAdd.job.focus();
    return false; }else if(document.staffAdd.sub.value=="" && (document.staffAdd.job.value=="202" || document.staffAdd.job.value=="416")){
    alert("Please Enter Teaching Subject Area!");
    //document.staffAdd.sub.focus();
    return false; }else if(document.staffAdd.sub.value!="" && document.staffAdd.job.value!="202" && document.staffAdd.job.value!="416"){
    alert("Teaching Subject Area must be null for this Job Classification Code! Please leave it at 'Select Teaching Subject Area'");
    document.staffAdd.sub.focus();
    return false; }else if((document.staffAdd.adm.value=="") && (document.staffAdd.job.value >= 100) && (document.staffAdd.job.value < 300)){
    alert("Please Enter Adminstrator/Instructional Area!");
    document.staffAdd.adm.focus();
    return false; }else if(document.staffAdd.adm.value!="" && ((document.staffAdd.job.value < 100) || (document.staffAdd.job.value >= 300)) ){
    alert("Adminstrator/Instructional Area must be null for this Job Classification Code! Please leave it at 'Select Adminstrator/Instructional Area'");
    document.staffAdd.adm.focus();
    return false; }else if(document.staffAdd.princ.value==""){
    alert("Please Select Principal Level!");
    document.staffAdd.princ.focus();
    return false; }else if(document.staffAdd.princ.value!="1" && document.staffAdd.job.value=="202" && document.staffAdd.adm.value=="0034"){
    alert("Please Principal Level MUST be 'Infant' for this record!");
    document.staffAdd.princ.focus();
    return false; }else if(document.staffAdd.princ.value!="2" && document.staffAdd.job.value=="202" && document.staffAdd.adm.value=="0035"){
    alert("Please Principal Level MUST be 'Preschool' for this record!");
    document.staffAdd.princ.focus();
    //return false; }else if((document.staffAdd.princ.value=="1" || document.staffAdd.princ.value=="2") && (document.staffAdd.adm.value!="0034" && document.staffAdd.adm.value!="0035")){
    //alert("Please Principal Level MUST NOT be Infant or Preschool for this record!");
    //document.staffAdd.princ.focus();
    return false; }else if(document.staffAdd.stat.value==""){
    alert("Please Select Employment Status!");
    document.staffAdd.stat.focus();
    return false; }else if((document.staffAdd.sal.value=="") && (document.staffAdd.ben.value=="")){
    alert("Salary and Employee Benefits MAY NOT both be blank!!");
    document.staffAdd.sal.focus();
    return false; }else if((document.staffAdd.stat.value=="04" ||document.staffAdd.stat.value=="06") && (document.staffAdd.ben.value!="")){
    alert("Employee Benefits MUST be blank for Purchased Service Staff!!");
    document.staffAdd.ben.focus();
    return false; }else if((document.staffAdd.fte.value > 0.25) && (document.staffAdd.stat.value=="05" || document.staffAdd.stat.value=="06" || (document.staffAdd.job.value=="202" && document.staffAdd.adm.value=="0032"))){
    alert("FTE must be less than or egual to 0.250 for this record!");
    return false; }else if((document.staffAdd.project.value =="B - Extended School Year or Summer School") && (document.staffAdd.stat.value!="05" && document.staffAdd.stat.value!="06")){
    alert("For Project B - Extended School Year or Summer School, Employment Status Code must be 05 or 06!");
    document.staffAdd.stat.focus();
    return false; }else if((document.staffAdd.project.value !="B - Extended School Year or Summer School") && (document.staffAdd.stat.value=="05" || document.staffAdd.stat.value=="06")){
    alert("For Project A and C, Employment Status Code must not be 05 or 06!");
    document.staffAdd.stat.focus();
    return false; }
    return checkFTE(document.staffAdd.fte);
    function checkAmount(textObj){
         return isAmountNumber(textObj.value);
    function isAmountNumber(strValue){
       if(!isWhitespace (strValue)){
       if(!isInteger(strValue)){  
            alert("Enter a valid amount!");
            return false;
       return true;
    function checkFTE(textObj){
         return isFTEFloat(textObj.value);
    function isFTEFloat(strValue){
       if(!isWhitespace (strValue)){
       if(!isFloat(strValue)){  
            alert("Enter a valid FTE!");
            return false;
       }else if( strValue > 1 || strValue < 0.001 ){
       alert("FTE cannot be greater than 1 or less than 0.001!");
       return false;
       var result=Math.round(strValue*1000)/1000
       document.staffAdd.fte.value = result;
       return true;
    function checkJobClass(textObj){
         return isJobClassInt(textObj.value);
    function isJobClassInt(strValue){
       if(!isInteger(strValue)){
            alert("Enter a valid Job Class Code!");
            return false;
       return true;
    function ssnTab(){
        var num = document.staffAdd.ssn.value;
        if((num.length)==document.staffAdd.ssn.maxLength)
        document.staffAdd.fname.focus();
    //-->
    </SCRIPT>
    <table width="100%" border="0" cellpadding="2" cellspacing="0">
      <tr>
        <td width="15%" rowspan="3" valign="top"><jsp:include page="menu.jsp" flush="true" />     </td>  
      </tr>
      <tr>
        <td valign="top">
             <form  name="staffAdd" id="staffAdd" method="post" action="addStaffRecordAction.jsp">
            <table width="100%" border="0" cellspacing="0" cellpadding="2"  >
              <tr>
                <td><jsp:include page="header.jsp" flush="true" /></td>
              </tr>
                    <tr>
                <td align="center"></td></tr>
              <tr>
                <td>
                  <table width='100%' border=0 cellspacing=0 cellpadding=2 align=center>
                    <tr>
                      <td align=center>
                        <table id="staffTable" width="100%" border="0" cellpadding="2" cellspacing="0">
                          <tr>
                            <td align="center">
                              <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                <tr>
                                <td><span STYLE="color: #990000; font-family: verdana, arial, helvetica; font-size: 12pt; font-weight: bold">Add New Staff Record</span>
                                    <br><br>This page allows the user to add a staff record to the system database. Enter all required
                                    data <font style=color:rgb(0,0,255)>marked in blue with *</font>, then click on the "Add Staff" button.<br>
                                </td>
                                </tr>
                                <tr>
                                  <td align="center"><b><span style="font-size: 11pt; color: #FF0000"/> <%= infoMessage%><span id="divMessage"/></b>
                                  </td>
                                </tr>
                              </table>
                              <br>
                    <table width="100%" border="0" cellspacing="1" cellpadding="2" >
                           <tr   >
                         <td align="right" width="15%"><b>Federal Funds: </b></td>
                          <td align="left" ><span style="color:rgb(128,0,0);" >
                          <input name="fundSourceDesc" value="<%=staff.getFundDesc()%>"  readonly style="border-style:outset; background-repeat:repeat; text-align:center;" size="30" />
                          <input name="fundSourceCode" value="<%=staff.getFundCode()%>"  type="hidden"/>
                                </span></td>
                           <td align="right" width="10%"><b>Project: </b></td>
                           <td align="left" ><span style="color:rgb(128,0,0);" >
                           <input name="project" value="<%=staff.getProjectCode() + " - " + staff.getProjectDesc()%>"  readonly style="border-style:outset; background-repeat:repeat; text-align:center;" size="50" />
                           </span></td> </tr>
                      </table>
                              <br>
                              <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#e1e1e1">
                                <tr bgcolor="#ccccff" >
                                  <td  align="center"><span style="font-size: 8pt; color:rgb(0,0,255)"><b>*SSN</b></span></td>
                                  <td  align="center"><span style="font-size: 8pt; color:rgb(0,0,255)"><b>*First Name</b></span></td>
                                  <td  align="center"><span style="font-size: 8pt; color: #990000"><b>Middle Name</b></span></td>
                                  <td  align="center"><span style="font-size: 8pt; color:rgb(0,0,255)"><b>*Last Name</b></span></td>
                                  <td  align="center"><span style="font-size: 8pt; color:rgb(0,0,255)"><b>* School District/BOCES</b></span></td>
                                </tr>
                                <tr bgcolor="white">
                                  <td align="center" ><span style="font-size: 8pt">                                
                                  <input type="text" align="left" name="ssn" value="<%= m_ssn %>" size="15" maxlength="9" onchange="return checkSSN(this)" onkeyup="return ssnTab()" onfocus="ssnfoc()"/>
                                  </span></td>
                                  <td align="center" ><span style="font-size: 8pt">                                
                                  <input type="text" align="left" name="fname" value="<%= m_fname %>" size="15" maxlength="20" onchange=" return validateFirstName(this)" onfocus="fnamefoc()"/>
                                  </span></td>
                                  <td align="center" ><span style="font-size: 8pt">                                
                                  <input type="text" align="left" name="mname" value="<%= m_mname %>" size="15" maxlength="20" onchange="return validateMiddleName(this)" onfocus="mnamefoc()"/>
                                  </span></td>
                                  <td align="center" ><span style="font-size: 8pt">                                
                                  <input type="text" align="left" name="lname" value="<%= m_lname %>" size="15" maxlength="20" onchange="return validateLastName(this)" onfocus="lnamefoc()"/>
                                  </span></td>
                                  <td align="center"><span style="font-size: 8pt">                                      
                                  <select name="dist"  style="width: 200px" onfocus="distfoc()">
                                  <%
                                  if(role.equals("1")){
                                  %>
                                  <option value="" selected>Select District/BOCES</option>
                                  <%
                                  Iterator it = Districtpage.getList().iterator();
                                  while(it.hasNext()){
                                  DistrictVO distVO = (DistrictVO)it.next();
                                  String distName = distVO.getDistrictName();
                                  String distCode = distVO.getDistrictCode();
                                  if ((distCode != null) && (m_dist.equals(distCode))){
                                  %>
                                  <option value="<%=distCode%>" selected><%=distName%></option>
                                 <% }else{ %>
                                  <option value="<%=distCode%>" ><%=distName%></option>
                                 <%} }
                                 }else if(role.equals("3")){
                                 Iterator it = Districtpage.getList().iterator();
                                  while(it.hasNext()){
                                  DistrictVO distVO = (DistrictVO)it.next();
                                  String distName = distVO.getDistrictName();
                                  String distCode = distVO.getDistrictCode();
                                  m_dist = agencyCode;
                                 if ((distCode != null) && (m_dist.equals(distCode))){
                                  %>
                                  <option value="<%=distCode%>" selected><%=distName%></option>
                                 <%} }
                                 }else if(role.equals("2")){
                                 %>
                                 <option value="" selected>Select District/BOCES</option>
                                 <%
                                  Iterator it = Distpage.getList().iterator();
                                  while(it.hasNext()){
                                  DistrictVO distVO = (DistrictVO)it.next();
                                  String distName = distVO.getDistrictName();
                                  String distCode = distVO.getDistrictCode();
                                 if ((distCode != null) && (m_dist.equals(distCode))){
                                  %>
                                  <option value="<%=distCode%>" selected><%=distName%></option>
                                 <%}else if(distCode != null){
                                 %>
                                  <option value="<%=distCode%>" selected><%=distName%></option>
                                 <%} }
                                 }%>
                                  </select>
                                  </span></td>
                                </tr>
                              </table>                         
                              <br>
                              <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#e1e1e1">
                                <tr bgcolor="#ccccff" >
                                <td width="20%" align="center"><span style="font-size: 8pt; color: #990000"><b>FTE</b></span></td>
                                <td width="20%" align="center"><span style="font-size: 8pt; color: #990000"><b>Salary</b></span></td>
                                  <td width="20%" align="center"><span style="font-size: 8pt; color: #990000"><b>Employee Benefits</b></span></td>
                                  <td width="20%" align="center"><span style="font-size: 8pt; color:rgb(0,0,255)"><b>*Payroll Beg Month</b></span></td>
                                  <td width="20%" align="center"><span style="font-size: 8pt; color:rgb(0,0,255)"><b>*Payroll End Month</b></span></td>
                                </tr>
                                <tr bgcolor="white"><td align="center"><span style="font-size:8pt">
                                  <input type="text" align="left" name="fte" size="9" value="<%= m_fte %>" onchange="return checkFTE(this)" onfocus="ftefoc()"/></span>
                                  </td>
                                <td align="center"><span style="font-size:8pt">
                                  <input type="text" align="left" name="sal" size="15" value="<%= m_sal %>"  onchange="return checkAmount(this)" onfocus="salfoc()"/></span>
                                  </td>
                                  <td align="center"><span style="font-size: 8pt">
                                  <input type="text" align="left" name="ben" size="15" value="<%= m_ben %>" onchange="return checkAmount(this)" onfocus="benfoc()"/></span>
                                  </td>
                                  <td align="center"><span style="font-size: 8pt">                                      
                                  <select name="begmn" style="width: 160px"  onfocus="begmnthfoc()">
                                  <% if(m_begmn.equalsIgnoreCase("")){%>
                                  <option value="" selected>Select Begining Month</option>
                                   <option value="January">January</option>
                                   <option value="February">February</option>
                                   <option value="March">March</option>
                                   <option value="April">April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("January")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" selected>January</option>
                                   <option value="February">February</option>
                                   <option value="March">March</option>
                                   <option value="April">April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("February")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" selected>February</option>
                                   <option value="March">March</option>
                                   <option value="April">April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("March")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" selected>March</option>
                                   <option value="April">April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("April")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" selected>April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                    <%}else if(m_begmn.equalsIgnoreCase("May")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" selected>May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("June")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" selected>June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("July")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" >June</option>
                                   <option value="July" selected>July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("August")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" >June</option>
                                   <option value="July" >July</option>
                                   <option value="August" selected>August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("September")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" >June</option>
                                   <option value="July" >July</option>
                                   <option value="August" >August</option>
                                   <option value="September" selected>September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("October")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" >June</option>
                                   <option value="July" >July</option>
                                   <option value="August" >August</option>
                                   <option value="September" >September</option>
                                   <option value="October" selected>October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("November")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" >June</option>
                                   <option value="July" >July</option>
                                   <option value="August" >August</option>
                                   <option value="September" >September</option>
                                   <option value="October" >October</option>
                                   <option value="November" selected>November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_begmn.equalsIgnoreCase("December")){%>
                                   <option value="" >Select Begining Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" >June</option>
                                   <option value="July" >July</option>
                                   <option value="August" >August</option>
                                   <option value="September" >September</option>
                                   <option value="October" >October</option>
                                   <option value="November" >November</option>
                                   <option value="December" selected>December</option>
                                   <%}%>
                                  </select>
                                  </span></td>
                                  <td align="center"><span style="font-size: 8pt">                                      
                                  <select name="endmn" style="width: 160px"  onfocus="endmnthfoc()">
                                  <% if(m_endmn.equalsIgnoreCase("")){%>
                                  <option value="" selected>Select Ending Month</option>
                                   <option value="January">January</option>
                                   <option value="February">February</option>
                                   <option value="March">March</option>
                                   <option value="April">April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_endmn.equalsIgnoreCase("January")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" selected>January</option>
                                   <option value="February">February</option>
                                   <option value="March">March</option>
                                   <option value="April">April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_endmn.equalsIgnoreCase("February")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" selected>February</option>
                                   <option value="March">March</option>
                                   <option value="April">April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_endmn.equalsIgnoreCase("March")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" selected>March</option>
                                   <option value="April">April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_endmn.equalsIgnoreCase("April")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" selected>April</option>
                                   <option value="May">May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                    <%}else if(m_endmn.equalsIgnoreCase("May")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" selected>May</option>
                                   <option value="June">June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_endmn.equalsIgnoreCase("June")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" selected>June</option>
                                   <option value="July">July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_endmn.equalsIgnoreCase("July")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" >June</option>
                                   <option value="July" selected>July</option>
                                   <option value="August">August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_endmn.equalsIgnoreCase("August")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</option>
                                   <option value="March" >March</option>
                                   <option value="April" >April</option>
                                   <option value="May" >May</option>
                                   <option value="June" >June</option>
                                   <option value="July" >July</option>
                                   <option value="August" selected>August</option>
                                   <option value="September">September</option>
                                   <option value="October">October</option>
                                   <option value="November">November</option>
                                   <option value="December">December</option>
                                   <%}else if(m_endmn.equalsIgnoreCase("September")){%>
                                   <option value="" >Select Ending Month</option>
                                   <option value="January" >January</option>
                                   <option value="February" >February</opti

    I'm not sure if this is an artefact of the way you're representing the breakpoint, but it looks like you're putting it on a blank line inside the scriptlet. Breakpoints in Java code only work if there's an actual line of code to break at. Try putting your breakpoint on the same line as
    String fn = user.getFullName();Note that even that will only work because it contains an assignment; you can't break at a plain declaration either.

  • Custom tag attribute calculated by scriptlet expression

    Hi,
              If I set the rtexprvalue subelement of the attribute element in my tld to
              "true", should I be able to dynamically determine the value of my custom tag
              attribute using a scriptlet expression?
              When I include the custom tag reference:
              <prod:getCategory id="category"
              categoryID="<%=request.getParameter("catID")%>" scope="page"/>
              it actually gets written to the html as:
              <prod:getCategory id="category" categoryID="2133" scope="page"/>
              and is not recognized as a jsp tag.
              I am using weblogic 6.0 sp1.
              Thanks in advance!
              daniel
              

    I had the same problem in a design a couple of months ago and could not get around it so I switched the functionality into code and out of the tag lib.
    I take it you are trying to do something like this?
    <%
    String value="hiworld";
    %>
    <mytaglib:saysomething value="<%=value%>"/>

  • Struts tags versus JSTL tags

    Hi all,
    I'm trying to determine the performance and code generation differences between Struts and JSTL tags. Currently I have a very large JSP which is part of a Struts based application and it's teethering on the edge of the 'code too large for method' issue.
    Would replacing Struts based tags with JSTL tags reduce the amount of code generated in a jspService method for a JSP? For example replacing
    logic:equal or logic:match with c:if test="..."
    I would appreciate anyone opinion on this.
    Thanks,
    Paul

    Thanks,
    We've already followed those guidelines. It's really more to do a decision by our functional design team who decided to combine the functionality of two pages into one, which is something we should have flagged initially.
    Now we are left with this task of attempting to optimise. It's not the
    perfect solution.
    There is heavy use of logic:equal/match tags throughout the JSP and my initial investigation is that a c:if test="..." seems to generate less
    lines of code because there are not as many attributes to set on the
    object.
    Would anyone agree with me on that?
    Thanks,
    Paul

  • Hide Parameter Pane using Report Properties Code

    Hi,
    I want to collapse the Parameters pane by default when the users view the report through the URL.
    I have read other similar threads and understood the below.
    It is possible by appending the command rc:Parameters=Collapsed. But this is only in ReportServer URL and not in Reports URL.
    This works fine. But, when the user accessing the report from
    http://servername/ReportServer, you cant expect him to append this text everytime. I also found that it can be somehow achieved using Report Properties Code. But, since Im new to that, unable to get how to achieve the same.
    Could someone share an example of how to set the default property of rc:Parameters to Collapsed using Code?
    Thanks,
    Akalya

    Hi Akalya,
    According to your description, you want to hide parameter pane when the user accessing the report from Report Manager. To achieve this goal, we can click “Show/Hide Parameters” arrow to hide the parameter pane after view the report from Report Manager.
    Besides, if I understand correctly, you had specify default values for all report parameters, so you want to hide parameter pane. If in this scenario, we can hide all parameters and then the parameter pane will be hidden.
    For example, open the report Properties page on Report Manager and go to Parameter tab, click the "Hide" selection for all parameters. We can also hide the parameters by specify the parameter visibility with "Hidden" before you deploy the report to Report
    Server.
    If there are any other questions, please feel free to ask.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Can I use c:out JSTL tag with int values?

    I am attempting to c:out an int variable in my JSP using a JSTL core tag. First is it possible to do c:out an int? Second, if it is...can anyone see anything wrong with my code?
    This is the error log I am getting:
    <Oct 7, 2008 10:20:29 AM MDT> <Error> <HTTP> <BEA-101017> <[ServletContext(id=20
    462449,name=rconnect,context-path=/rconnect)] Root cause of ServletException.
    javax.servlet.jsp.JspException: ServletException in '/WEB-INF/pages/signup/summa
    ry.jsp': An error occurred while evaluating custom action attribute "value" with
    value "${orderForm.numOtaModulesSelected}": Unable to find a value for "numOtaM
    odulesSelected" in object of class "com.echostar.rconnect.struts.formbeans.Order
    FormBean" using operator "." (null)
    This is the code:
    <c:out value="${orderForm.numOtaModulesSelected}" />where numOtaModulesSelected is defined as a private member variable of the OrderFormBean
    I have included the taglib.
    Thanks to anyone who can help

    Your OrderFormBean class needs to implement a getNumOtaModulesSelected method for that to work. The expression language won't let you get at fields, you need to access it via JavaBeans properties.

  • I can't use JSTL tag for read rss.

    I want to read rss from another web. but I can't read rss . I use Netbeans and I add JSTL Library already. I can use forEach tag but every time when I use xml tag it show error. This is my code for read rss. I don't know how to read rss with JSTL tag please help me.
    <h6><!-- Filename: ShowStudents.jsp -->
    <%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <HTML>
    <BODY>
    <c:import var="xmlDoc" url="http://www.manager.co.th/RSS/Home/Breakingnews.xml"/>
    <x:parse var="parsedDocument" xml="${xmlDoc}"/>
    <table>
    <tr>
    <th>Title : </th>
    <th>Link : </th>
    </tr>
    <x:forEach select="$parsedDocument/channel/item"> // This code I ever been change to $parsedDocument/rss/channel/ and $parsedDocument/rss/channel/title ,but it show same error.
    <tr>
    <td> <x:out select="title" /> </td>
    <td> <x:out select="link" /> </td>
    </tr>
    </x:forEach>
    </table>
    </BODY>
    </HTML></h6>
    when I run this code it show error like this. how to read rss with JSTL tag please help me.
    <h6>
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    Filter.ThaiRequest.doFilter(ThaiRequest.java:38)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
    org.apache.jsp.test_jsp._jspService(test_jsp.java:101)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    Filter.ThaiRequest.doFilter(ThaiRequest.java:38)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    root cause
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
    com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(ParseSupport.java:227)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(ParseSupport.java:193)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(ParseSupport.java:199)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(ParseSupport.java:206)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(ParseSupport.java:138)
    org.apache.jsp.test_jsp._jspx_meth_x_005fparse_005f0(test_jsp.java:150)
    org.apache.jsp.test_jsp._jspService(test_jsp.java:80)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    Filter.ThaiRequest.doFilter(ThaiRequest.java:38)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    </h6>
    Edited by: user12864851 on 15 ม.ค. 2554, 22:59 น.

    Ok, I did a bit more experimenting, and web searching, and found you are the victim of the UTF-8 BOM bug.
    Basically the java UTF-8 reader does not recognise a BOM at the start of a UTF-8 stream, and it has to be discarded manually.
    For details: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
    Here is a 'fixed' JSP for you.
    <%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
    <%@ page contentType="text/html; charset=UTF-8"%>
    <HTML>
    <BODY>
         <c:import var="xmlDoc"
              url="http://www.manager.co.th/RSS/Home/Breakingnews.xml"
              charEncoding="UTF8" />
         <%--
            JSTL hack to work around the UTF-8 BOM bug in JDK.
            http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
         --%>
         <c:set var="testChar" value="fn:substring(xmlDoc, 0, 1)}"/>
         <c:if test="${testChar != '<'}">
           <c:set var="xmlDoc" value="${fn:substring(xmlDoc, 1, fn:length(xmlDoc))}" />
         </c:if>
         <table>
              <tr>
                   <th>Title :</th>
                   <th>Link :</th>
              </tr>
              <x:parse var="parsedDocument" doc="${xmlDoc}" />
              <x:forEach select="$parsedDocument/rss/channel/item">
                   <tr>
                        <td><x:out select="title" /></td>
                        <td><x:out select="link" /></td>
                   </tr>
              </x:forEach>
         </table>
    </BODY>
    </HTML>cheers,
    evnafets

  • How to write this java code in jsp using jstl  tags?

    Can anybody help me on this?
    I dont know how to check the containsKey using jstl tags?
    <%
         LinkedHashMap yearMap     =     (LinkedHashMap)request.getAttribute("yearMap");
         TreeSet nocSet               =     (TreeSet)request.getAttribute("nocSet");
         Iterator     yearMapIt     =     yearMap.keySet().iterator();
         while(yearMapIt.hasNext())
              int yearValue               =     (Integer)yearMapIt.next();
    %>
    <tr>
              <td><%=yearValue%></td>
    <%
              LinkedHashMap monthMap     =     (LinkedHashMap)yearMap.get(yearValue);
              Iterator     nocSetIt     =     nocSet.iterator();
              while(nocSetIt.hasNext())
                   String nCase=(String)nocSetIt.next();
                   if(monthMap.containsKey(nCase))
                        String count     =     (String)monthMap.get(nCase);
    %>
                        <td> <%= count %> </td>
    <%            }
                   else
    %>          
                        <td> 0 </td>     
    <%          
    %>
    </tr>
    <% } %>Edited by: avn_venki on Feb 18, 2008 11:54 PM

    <c:forEach var="yearMap" items="${requestScope.yearMap}">
         <th> <c:out value="${yearMap.key}"/> </th>
    <bean:define id="monthMap" value="${yearMap.value}"/>
    <c:forEach var="nocSet" items="${nocSet}">
    then how to write containsKey using tags??

  • How can i use the project code instead of project xml?

    hello
    i use the sessionbean+toplink structure,after i finish the o-r mapping by using the mapping work bench,i generate the project xml file,then in the "session.xml" file,i refer to the project xml,then i can use it from sessionbean.
    i hear that if i use the project code instead of project xml file,it will be more performant,is that true?
    otherwise,how can i use the project code instead of project xml file?i mean, in "session.xml", i can use the "<project-xml>" tag to refer to the project xml file,then in my session bean,i get the server session by read the "session.xml" file.but if i use the project code,how can i refer it from the "session.xml"?the examples that come with the toplink installation only tell me how can i use the project xml file within the session bean,it don't give me any clue about using the project code in the sesion bean,who can give me a step-by-step instruction and code snippet?
    thank you very much?

    There is a slight performance gain during session load at startup but there is no difference at runtime. The choice of which to use is dependent upon you build process. Whether it is easier to submit a new version of the class into the comile build process vs an XML file. In most cases it is just a preference of the development team.
    When you use the project-class you'll need to generate the source code and compile it into your system. Typically it is packaged with the persistent classes. You may need to configure your environment so that the class-loaders have access to these classes (same for the XML case).
    When using the project-class you simply replace the project-xml entry like this:
    <project-class>oracle.toplink.demos.employee.relational.EmployeeProject</project-class>
    The DTD for the session.xml file is found at <TOPLINK_HOME>\core\sessions_4_5.dtd. It is also in the documentation at:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/toplink.903/b10064/a-sessio.htm#634246
    Doug Clarke
    Product Manager
    Oracle9iAS TopLink

  • How to numberformat when using sql:query alogn with c:forEach JSTL tags

    Is there anyway to format the numeric values returned from the database when using <sql:query> alogn with <c:forEach> tags
    Here is my jsp code
    <sql:query..../>
    <c:forEach var="row" items="${queryResults.rows}">
    <tr>
    <td><c:out value="${row.COL1}" /></td>
    <td><c:out value="${row.COL2}" /></td>
    </tr>
    </c:forEach>
    Col1 values are numeric without any formats Eg: 1000, 10000, 1000000 etc.
    how can i format them to 1,000 , 10,1000 , 100,000 etc

    It is polite to mention what your answer was. These posts are not just here for you to ask questions, but to be used as a resource for other people to find answers. Saying "I solved it" with no details helps noone.
    I presume you discovered the JSTL <fmt:formatNumber> tag?

  • Use var of sql:query tag into a jsp fragment code

    Hi, i'm spanish and my english is not very good XD.
    I need to use some data from <sql:query> tag into code jsp <% %>
    EXAMPLE:
    <sql:query var="variable">
    </sql:query>
    <% what can i do to access to "variable" here????????? %>
    i need to save in session (session.setAttribute(...)) a field of the response of the query saved in "variable"
    i need help!!!!, thanks!!!!!!!!

    i need to save in session (session.setAttribute(...)) a field of the response of the query saved in "variable"Why do you need java code to do this? If you are using JSTL sql tags, then why not keep using JSTL tags?
    <c:set var="valueToSave" value="${variable.field}" scope="session"/>EL variables are actually already stored as attributes in scope.
    So to get hold of "variable" you could use <%= pageContext.findAttribute("variable") %>
    and that would give you the object stored by the EL.
    cheers,
    evnafets

  • Cannot use jstl tag for jsp page which generated from Human Task

    Hi
    Plz help me.
    I have tried to using jstl in jsp which generate from Human Task and I deploy it to server( by ant on Jdev ) to see task detail in Oracle Worklist application. But when i submit task and then I access to worklist to see task detail, the error has show in page that "OracleJSP: An error occurred. Consult your application/system administrator for support. Programmers should consider setting the init-param debug_mode to "true" to see the complete exception message. " .
    I access server to see application.log to see error and I see error show "workflowform: JspServlet: unable to dispatch to requested page: Exception:oracle.jsp.parse.JspParseException: /Header1.jsp: Line # 3, <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> "
    How do I fix this error?
    PS. I tried to us jstl because I need to connet to database which jstl tag(sql) if somebody has another solution for connect database in task detail page, Please help suggest me.
    Thanks
    user520932

    Is the jstl tag libray loaded in the appsserver?
    Can you use jdbc connection like
    DataSource ds = ic.lookup("java:comp/env/jdbc/myDB");
    Connection con = ds.getConnection();
    DataSource ds = (DataSource) org.apache.derby.jdbc.ClientDataSource()
    ds.setPort(1521);
    ds.setHost("localhost");
    ds.setUser("APP")
    ds.setPassword("APP");
    Connection con = ds.getConnection();
    http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html

  • Problem in using JSTL tag libs

    Hi there,
    I am trying to use JSTL tag libs in my web app, but i get the following error message:
    org.apache.jasper.JasperException: /index.jsp(22,0) According to TLD or attribute directive in tag file, attribute test does not accept any expressions
    as it might be clear i am using Tomcat and line 22 of the code for index.jsp is:
    <c:if test="${user.role > 0 }">
    Please help my identify whats wrong in there. I suspect that it is because of my web.xml file, but i am not sure.
    thanx in advance,
    Capitan Haddock

    try to use gt instead of >

  • I can't use have JSP code in jsp:forward ?

    when i try to use
    <jsp:forward page="product.jsp?id=<% out.print(bid.getItemID()); %>&action=bidfail" />it dont seem to have any id value?
    i will get something like
    /AuctionProject/product2.jsp?id=<% out.print(bid.getItemID()); %>&action=bidfailhow can i have some jsp code inside the forward url? like in this case i need a item ID

    You can use run time expressions in jsp:forward, but you shouldn't use a scriptlet with out.print(...). Instead use an expression. An expression looks like <%= value to display %> instead of <% out.print(value to display) %>
    <jsp:forward page="product.jsp?id=<%= bid.getItemID() %>&action=bidfail" />See the JSP Syntax Reference at: [http://java.sun.com/products/jsp/syntax/2.0/syntaxref20.html |http://java.sun.com/products/jsp/syntax/2.0/syntaxref20.html]

Maybe you are looking for

  • Still Can't Figure Out Returning to Page with URL Parameters

    Hi, I am trying to figuring out how after submitting a form to return to a previous webpage with URL parameters in it. Any ideas? Thanks, Craig

  • Calculating fields in Flash

    Hi. I need to add rows of data in flash and have them total up on the last row as the items are checked. Looking at the following example, if someone checks a tickbox next to items 01 and 02, the total sum would appear on the last row for each column

  • Install  NW2004SR2 error while configure EP (phase 37 of 39)

    Hi , I install NW2004S R2 ,Oracle db+JAVA Stack on RHEL5, JDK version is 1.4.2_12. In the phase of 37 of 39 (Configure Enterprise Portal), an error occurred. =>Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/engine/offline/OfflineT

  • Help needed with flash and web service call

    Hi all, I need some help with web services and flash. I'm very new to flash, so please have that in the back of your mind when reading this :-) I've got a .swf file, and I would like to display a number received from a web service (using adobe flash

  • Creating a photoshop action to save a batch of images as patterns

    I am trying to use Photoshop actions to script about a thousand image files into PAT files. I am running into a problem with actions when it comes to defining a pattern. The program naturally selects the filename as the name of the pattern when doing