You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Peter Choe <ch...@mindspring.com> on 2003/10/27 19:04:14 UTC

dbtags - question

i am using dbtags library in my jsp file.

i have the following set up:

<table border="1">
<tr><th>Course</th><th>Days of Week</th><th>Time</th><td></td></tr>
<sql:preparedStatement id="pstmt" conn="con">
  <sql:query>SELECT crs_id, discipline, course_num, days_of_week, 
time_slot FROM time_slots, wait_list_course WHERE 
time_slots.time_id=wait_list_course.t
ime_id AND is_available='Yes' AND discipline=? AND 
wait_list_course.semester=?</sql:query>
  <sql:setColumn 
position="1"><%=request.getParameter("discipline")%></sql:setColumn>
  <sql:setColumn position="2"><%=semester%></sql:setColumn>      
  <sql:resultSet id="rs">
     <tr><td>
        <sql:getColumn position="2" />
        <sql:getColumn position="3" /></td><td>
        <sql:getColumn position="4" /></td><td>
        <sql:getColumn position="5" /></td><td>
           <sql:preparedStatement id="pstmt2" conn="con">
              <sql:query>SELECT added, removed FROM student_status WHERE 
crs_id=? AND student_id=? AND added is not null</sql:query>
                 <sql:setColumn position="1"><sql:getColumn position="1" 
/></sql:setColumn>
                 <sql:setColumn 
position="2"><%=(String)session.getAttribute("sid")%></sql:setColumn>
                 <sql:resultSet id="rs2">
                 </sql:resultSet>
                 <sql:wasEmpty><input type="button" name="add" 
value="Add Me" onClick="getOn('<sql:getColumn position="1" />', 
'add')"></sql:wasEmpty>
                 <sql:wasNotEmpty><b>Added</b></sql:wasNotEmpty>
           </sql:preparedStatement></td></tr>
  </sql:resultSet>
  <sql:wasNotEmpty />
  <sql:wasEmpty><tr><td 
colspan="4"><%=request.getParameter("discipline")%> currently has no 
courses available for wait list for <%=session.getAttribute(
"semester")%> semester.</td></tr></sql:wasEmpty>
</sql:preparedStatement>
<tr><td colspan="4" align="center"><a 
href="/registrar_appt/waitlist/menu.jsp">Back to main menu</a></td></tr>
</table>
</form>
</center>

when i run the page in the web browser the value of the <sql:setColumn 
position="2"> <%=(String)session.getAttribute("sid")%></sql:setColumn> 
is shown on the web browser.  but this doesn't occur on a constant 
basis.  if i refresh the page, the value is not shown.  is the syntax 
correct or is there something i need to do to prevent the value from 
being processed by the web browser?

Peter Choe


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: setting locale

Posted by "Ruth, Brice" <br...@fiskars.com>.
I don't believe that the locale object in pageContext.request will be 
updated by the fmt JSTL that you're using - but, the locale sensitive 
JSTL tags for formatting numbers & dates should pick it up correctly ... 
is that working?

e wrote:

>
>
> What's wrong with this picture?  I can't seem to set the locale 
> correctly - it always prints out as en_US.
>
> <%@ taglib prefix="f" uri="http://java.sun.com/jstl/fmt" %>
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
>
>
> <f:setLocale value='es'/>
>
> <c:out value="${pageContext.request.locale}"/>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


setting locale

Posted by e <li...@medusadigital.com>.

What's wrong with this picture?  I can't seem to set the locale correctly - 
it always prints out as en_US.

<%@ taglib prefix="f" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>


<f:setLocale value='es'/>

<c:out value="${pageContext.request.locale}"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: dbtags - question

Posted by Adrian Beech <a....@bigpond.net.au>.
G'day Peter & list,

I'm getting similar behavior with the SQL query string being included as
part of the HTML text even though the SQL statement is definitely
between <sql:query> and </sql:query> tags.  I posted a question about
this last Sunday... alas though no response thus far from the list.

The behavior is inconsistent in that I can remove the apps working
directory (under work/standalone/localhost), restart Tomcat and in one
instance the SQL statement is not shown but repeating the process a
second or third time it will appear.  However in all cases the SQL
statement will be included as part of the HTML when ever the page is
reloaded and an empty result set is returned.  In my case I have an
overdue page which is refreshed every 3 minutes.  This is how the
problem first came to light when the page refreshed after it's initial
load.

This doesn't exactly help you with your problem.  Though it does
highlight that something astray is going on.

AB


-----Original Message-----
From: Peter Choe [mailto:choepete@mindspring.com] 
Sent: Tuesday, 28 October 2003 6:11 AM
To: Tag Libraries Users List
Subject: Re: dbtags - <sql:setColumn> question


the problem seems to be that if i use the session.getAttribute("sid"), 
it will display the value on the browser even though it is between the 
<sql:setColumn position="2"> .

so, i am not sure if this is a bug anyone has encountered before or if i

am doing something wrong?

a little help here.

Peter Choe


Manos Papantoniou wrote:

>I am not an expert, but it could be that when you refresh the page, the

><%=request.getParameter("discipline")%> value is empty. Or it could be 
>another variable that only has request-time life and not session-time 
>life duration, so the contents of the variable are empty when the 
>reload happens. Perhaps you want to experiment with changing some of 
>your request.* methods to session.* if possible or at least inspecting 
>their contents when you reload the page. Then again maybe somebody more

>experienced in this forum might have a better idea
>
>
>
>  ----- Original Message -----
>  From: Peter Choe 
>  To: taglibs-user@jakarta.apache.org 
>  Sent: Monday, October 27, 2003 6:04 PM
>  Subject: dbtags - <sql:setColumn> question
>
>
>  i am using dbtags library in my jsp file.
>
>  i have the following set up:
>
>  <table border="1">
>  <tr><th>Course</th><th>Days of Week</th><th>Time</th><td></td></tr>
>  <sql:preparedStatement id="pstmt" conn="con">
>    <sql:query>SELECT crs_id, discipline, course_num, days_of_week,
>  time_slot FROM time_slots, wait_list_course WHERE 
>  time_slots.time_id=wait_list_course.t
>  ime_id AND is_available='Yes' AND discipline=? AND 
>  wait_list_course.semester=?</sql:query>
>    <sql:setColumn 
>  position="1"><%=request.getParameter("discipline")%></sql:setColumn>
>    <sql:setColumn position="2"><%=semester%></sql:setColumn>      
>    <sql:resultSet id="rs">
>       <tr><td>
>          <sql:getColumn position="2" />
>          <sql:getColumn position="3" /></td><td>
>          <sql:getColumn position="4" /></td><td>
>          <sql:getColumn position="5" /></td><td>
>             <sql:preparedStatement id="pstmt2" conn="con">
>                <sql:query>SELECT added, removed FROM student_status
WHERE 
>  crs_id=? AND student_id=? AND added is not null</sql:query>
>                   <sql:setColumn position="1"><sql:getColumn
position="1" 
>  /></sql:setColumn>
>                   <sql:setColumn 
>  position="2"><%=(String)session.getAttribute("sid")%></sql:setColumn>
>                   <sql:resultSet id="rs2">
>                   </sql:resultSet>
>                   <sql:wasEmpty><input type="button" name="add" 
>  value="Add Me" onClick="getOn('<sql:getColumn position="1" />', 
>  'add')"></sql:wasEmpty>
>                   <sql:wasNotEmpty><b>Added</b></sql:wasNotEmpty>
>             </sql:preparedStatement></td></tr>
>    </sql:resultSet>
>    <sql:wasNotEmpty />
>    <sql:wasEmpty><tr><td 
>  colspan="4"><%=request.getParameter("discipline")%> currently has no 
>  courses available for wait list for <%=session.getAttribute(
>  "semester")%> semester.</td></tr></sql:wasEmpty>
>  </sql:preparedStatement>
>  <tr><td colspan="4" align="center"><a 
>  href="/registrar_appt/waitlist/menu.jsp">Back to main
menu</a></td></tr>
>  </table>
>  </form>
>  </center>
>
>  when i run the page in the web browser the value of the 
> <sql:setColumn
>  position="2">
<%=(String)session.getAttribute("sid")%></sql:setColumn> 
>  is shown on the web browser.  but this doesn't occur on a constant 
>  basis.  if i refresh the page, the value is not shown.  is the syntax

>  correct or is there something i need to do to prevent the value from 
>  being processed by the web browser?
>
>  Peter Choe
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: dbtags - question

Posted by Peter Choe <ch...@mindspring.com>.
the problem seems to be that if i use the session.getAttribute("sid"), 
it will display the value on the browser even though it is between the 
<sql:setColumn position="2"> .

so, i am not sure if this is a bug anyone has encountered before or if i 
am doing something wrong?

a little help here.

Peter Choe


Manos Papantoniou wrote:

>I am not an expert, but it could be that when you refresh the page, the <%=request.getParameter("discipline")%> value is empty. Or it could be another variable that only has request-time life and not session-time life duration, so the contents of the variable are empty when the reload happens. Perhaps you want to experiment with changing some of your request.* methods to session.* if possible or at least inspecting their contents when you reload the page. Then again maybe somebody more experienced in this forum might have a better idea
>
>
>
>  ----- Original Message ----- 
>  From: Peter Choe 
>  To: taglibs-user@jakarta.apache.org 
>  Sent: Monday, October 27, 2003 6:04 PM
>  Subject: dbtags - <sql:setColumn> question
>
>
>  i am using dbtags library in my jsp file.
>
>  i have the following set up:
>
>  <table border="1">
>  <tr><th>Course</th><th>Days of Week</th><th>Time</th><td></td></tr>
>  <sql:preparedStatement id="pstmt" conn="con">
>    <sql:query>SELECT crs_id, discipline, course_num, days_of_week, 
>  time_slot FROM time_slots, wait_list_course WHERE 
>  time_slots.time_id=wait_list_course.t
>  ime_id AND is_available='Yes' AND discipline=? AND 
>  wait_list_course.semester=?</sql:query>
>    <sql:setColumn 
>  position="1"><%=request.getParameter("discipline")%></sql:setColumn>
>    <sql:setColumn position="2"><%=semester%></sql:setColumn>      
>    <sql:resultSet id="rs">
>       <tr><td>
>          <sql:getColumn position="2" />
>          <sql:getColumn position="3" /></td><td>
>          <sql:getColumn position="4" /></td><td>
>          <sql:getColumn position="5" /></td><td>
>             <sql:preparedStatement id="pstmt2" conn="con">
>                <sql:query>SELECT added, removed FROM student_status WHERE 
>  crs_id=? AND student_id=? AND added is not null</sql:query>
>                   <sql:setColumn position="1"><sql:getColumn position="1" 
>  /></sql:setColumn>
>                   <sql:setColumn 
>  position="2"><%=(String)session.getAttribute("sid")%></sql:setColumn>
>                   <sql:resultSet id="rs2">
>                   </sql:resultSet>
>                   <sql:wasEmpty><input type="button" name="add" 
>  value="Add Me" onClick="getOn('<sql:getColumn position="1" />', 
>  'add')"></sql:wasEmpty>
>                   <sql:wasNotEmpty><b>Added</b></sql:wasNotEmpty>
>             </sql:preparedStatement></td></tr>
>    </sql:resultSet>
>    <sql:wasNotEmpty />
>    <sql:wasEmpty><tr><td 
>  colspan="4"><%=request.getParameter("discipline")%> currently has no 
>  courses available for wait list for <%=session.getAttribute(
>  "semester")%> semester.</td></tr></sql:wasEmpty>
>  </sql:preparedStatement>
>  <tr><td colspan="4" align="center"><a 
>  href="/registrar_appt/waitlist/menu.jsp">Back to main menu</a></td></tr>
>  </table>
>  </form>
>  </center>
>
>  when i run the page in the web browser the value of the <sql:setColumn 
>  position="2"> <%=(String)session.getAttribute("sid")%></sql:setColumn> 
>  is shown on the web browser.  but this doesn't occur on a constant 
>  basis.  if i refresh the page, the value is not shown.  is the syntax 
>  correct or is there something i need to do to prevent the value from 
>  being processed by the web browser?
>
>  Peter Choe
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: dbtags - question

Posted by Manos Papantoniou <ma...@h-infinity.co.uk>.
I am not an expert, but it could be that when you refresh the page, the <%=request.getParameter("discipline")%> value is empty. Or it could be another variable that only has request-time life and not session-time life duration, so the contents of the variable are empty when the reload happens. Perhaps you want to experiment with changing some of your request.* methods to session.* if possible or at least inspecting their contents when you reload the page. Then again maybe somebody more experienced in this forum might have a better idea



  ----- Original Message ----- 
  From: Peter Choe 
  To: taglibs-user@jakarta.apache.org 
  Sent: Monday, October 27, 2003 6:04 PM
  Subject: dbtags - <sql:setColumn> question


  i am using dbtags library in my jsp file.

  i have the following set up:

  <table border="1">
  <tr><th>Course</th><th>Days of Week</th><th>Time</th><td></td></tr>
  <sql:preparedStatement id="pstmt" conn="con">
    <sql:query>SELECT crs_id, discipline, course_num, days_of_week, 
  time_slot FROM time_slots, wait_list_course WHERE 
  time_slots.time_id=wait_list_course.t
  ime_id AND is_available='Yes' AND discipline=? AND 
  wait_list_course.semester=?</sql:query>
    <sql:setColumn 
  position="1"><%=request.getParameter("discipline")%></sql:setColumn>
    <sql:setColumn position="2"><%=semester%></sql:setColumn>      
    <sql:resultSet id="rs">
       <tr><td>
          <sql:getColumn position="2" />
          <sql:getColumn position="3" /></td><td>
          <sql:getColumn position="4" /></td><td>
          <sql:getColumn position="5" /></td><td>
             <sql:preparedStatement id="pstmt2" conn="con">
                <sql:query>SELECT added, removed FROM student_status WHERE 
  crs_id=? AND student_id=? AND added is not null</sql:query>
                   <sql:setColumn position="1"><sql:getColumn position="1" 
  /></sql:setColumn>
                   <sql:setColumn 
  position="2"><%=(String)session.getAttribute("sid")%></sql:setColumn>
                   <sql:resultSet id="rs2">
                   </sql:resultSet>
                   <sql:wasEmpty><input type="button" name="add" 
  value="Add Me" onClick="getOn('<sql:getColumn position="1" />', 
  'add')"></sql:wasEmpty>
                   <sql:wasNotEmpty><b>Added</b></sql:wasNotEmpty>
             </sql:preparedStatement></td></tr>
    </sql:resultSet>
    <sql:wasNotEmpty />
    <sql:wasEmpty><tr><td 
  colspan="4"><%=request.getParameter("discipline")%> currently has no 
  courses available for wait list for <%=session.getAttribute(
  "semester")%> semester.</td></tr></sql:wasEmpty>
  </sql:preparedStatement>
  <tr><td colspan="4" align="center"><a 
  href="/registrar_appt/waitlist/menu.jsp">Back to main menu</a></td></tr>
  </table>
  </form>
  </center>

  when i run the page in the web browser the value of the <sql:setColumn 
  position="2"> <%=(String)session.getAttribute("sid")%></sql:setColumn> 
  is shown on the web browser.  but this doesn't occur on a constant 
  basis.  if i refresh the page, the value is not shown.  is the syntax 
  correct or is there something i need to do to prevent the value from 
  being processed by the web browser?

  Peter Choe


  ---------------------------------------------------------------------
  To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
  For additional commands, e-mail: taglibs-user-help@jakarta.apache.org