Re: Why one way works, but not the other?
I'm not Karr by the way. In any event, using sessionScope.mbox.list might not have any impact on the output, but my main concern is that you're using the name of a JSTL implicit object in your loop. If what JSTL is really doing with ${header.from} is looking for an HTTP header called from, it definitely will impact your output. Quoting Vernon Wu [EMAIL PROTECTED]: Thanks, Karr. The change, however, shalln't have any impact on the final output, shall it? 10/21/2002 12:33:03 PM, Kris Schneider [EMAIL PROTECTED] wrote: You don't need the jsp:useBean action for JSTL to get at mbox. You can just do: c:forEach var=header items=${sessionScope.mbox.list} varStatus=status header is an implicit object in JSTL, so I'd call your iteration var something else, like hdr. Quoting Vernon Wu [EMAIL PROTECTED]: To illustrate the problem, I provide the following two parts of code/file sample. In a JSP file, I have the followings: jsp:useBean id=agentHelper class=com.xxx.web.client.AgentHelper scope=session / c:set value=${agentHelper.newMembers} var=pageResults / c:forEach var=item items=${pageResults.list} tr td class=TableRowColorc:out value=${item.headline} //td td class=TableRowColor c:url value=search-by-id-action.do var=viewItemURL c:param name=id value=${item.userId}/ /c:url a href='c:out value=${viewItemURL}/' onmouseover=img_on ('signout') onmouseout=img_off('signout') c:out value=${item.userId} / /a /td td class=TableRowColorc:out value=${item.age}//td /tr /c:forEach This page works fine. I use the other implementation method using MVC pattern instead for another page. In the controller, I have the followings: session.setAttribute(mbox, a.openMessageBox(0, 10)); The data is correct at this point. And in the following JSP file I have the followings: jsp:useBean id=mbox class=com.xxx.web.client.model.Page scope=session / c:forEach var=header items=${mbox.list} varStatus=status tr td input type=checkbox name=checkbox value=checkbox /td tdnbsp;/td tdc:out value=${header.from}//td tdc:out value=${header.subject}//td tdnbsp;/td /tr /c:forEach The iteration is walked through, but no data is displayed. I don't understand why the second implemention doesn't display the data. Can anyone see a problem here/ Thanks, Vernon -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
Re: Why one way works, but not the other?
You don't need the jsp:useBean action for JSTL to get at mbox. You can just do: c:forEach var=header items=${sessionScope.mbox.list} varStatus=status header is an implicit object in JSTL, so I'd call your iteration var something else, like hdr. Quoting Vernon Wu [EMAIL PROTECTED]: To illustrate the problem, I provide the following two parts of code/file sample. In a JSP file, I have the followings: jsp:useBean id=agentHelper class=com.xxx.web.client.AgentHelper scope=session / c:set value=${agentHelper.newMembers} var=pageResults / c:forEach var=item items=${pageResults.list} tr td class=TableRowColorc:out value=${item.headline} //td td class=TableRowColor c:url value=search-by-id-action.do var=viewItemURL c:param name=id value=${item.userId}/ /c:url a href='c:out value=${viewItemURL}/' onmouseover=img_on ('signout') onmouseout=img_off('signout') c:out value=${item.userId} / /a /td td class=TableRowColorc:out value=${item.age}//td /tr /c:forEach This page works fine. I use the other implementation method using MVC pattern instead for another page. In the controller, I have the followings: session.setAttribute(mbox, a.openMessageBox(0, 10)); The data is correct at this point. And in the following JSP file I have the followings: jsp:useBean id=mbox class=com.xxx.web.client.model.Page scope=session / c:forEach var=header items=${mbox.list} varStatus=status tr td input type=checkbox name=checkbox value=checkbox /td tdnbsp;/td tdc:out value=${header.from}//td tdc:out value=${header.subject}//td tdnbsp;/td /tr /c:forEach The iteration is walked through, but no data is displayed. I don't understand why the second implemention doesn't display the data. Can anyone see a problem here/ Thanks, Vernon -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
mt: Mailer Tag Error - mt:setrecipient - Help
Hello, After upgrading from Tomcat 4.0. to 4.1.12, I encountered weird errors with certain mailer tags (mt:). Specifically, the mt:setrecipient tag seems to hold on to a value previously set in a seperate session ! In my case, I have a form, which when submitted would also use the mt: tag to send an email to that user, passing them back information they just submitted in their form. Here is the example: mt:mail server=localhost from=[EMAIL PROTECTED] subject=Welcome mt:setrecipient type=to%= (request.getParameter(emailAddr)) %/mt:setrecipient mt:message type=text Welcome! Here is a reminder of your username and password to access the forums: Username: %= (request.getParameter(userName)) % Password: %= (request.getParameter(password)) % /mt:message mt:send/ /mt:mail Once this jsp is called, the setrecipient value will stay what it was the first time the jsp is processed. A seperate user, with a new session, calling the same jsp, will somehow have the orriginal Setrecipient value, and would send the email to the wrong address! (thankfully this is being worked out on our dev server). What is interesting is that if I set the recipient to my own account, and include the email paramter in the body of the message, it rights it there properly! so this works: mt:mail server=localhost from=[EMAIL PROTECTED] subject=Welcome mt:setrecipient type=to[EMAIL PROTECTED]/mt:setrecipient mt:message type=text Welcome! This email was intended for %= (request.getParameter(emailAddr)) % Here is a reminder of your username and password to access the forums: Username: %= (request.getParameter(userName)) % Password: %= (request.getParameter(password)) % /mt:message mt:send/ /mt:mail So, why can I not seem to populate the to for this email dynamicly? Why does it hold onto that value from the first request of this jsp and not process it properly? Any help or insight into this would be greatly appreciated, Thanks in advance, Patrick Swarts - Do you Yahoo!? Y! Web Hosting - Let the expert host your web site
Why one way works, but not the other?
To illustrate the problem, I provide the following two parts of code/file sample. In a JSP file, I have the followings: jsp:useBean id=agentHelper class=com.xxx.web.client.AgentHelper scope=session / c:set value=${agentHelper.newMembers} var=pageResults / c:forEach var=item items=${pageResults.list} tr td class=TableRowColorc:out value=${item.headline} //td td class=TableRowColor c:url value=search-by-id-action.do var=viewItemURL c:param name=id value=${item.userId}/ /c:url a href='c:out value=${viewItemURL}/' onmouseover=img_on ('signout') onmouseout=img_off('signout') c:out value=${item.userId} / /a /td td class=TableRowColorc:out value=${item.age}//td /tr /c:forEach This page works fine. I use the other implementation method using MVC pattern instead for another page. In the controller, I have the followings: session.setAttribute(mbox, a.openMessageBox(0, 10)); The data is correct at this point. And in the following JSP file I have the followings: jsp:useBean id=mbox class=com.xxx.web.client.model.Page scope=session / c:forEach var=header items=${mbox.list} varStatus=status tr td input type=checkbox name=checkbox value=checkbox /td tdnbsp;/td tdc:out value=${header.from}//td tdc:out value=${header.subject}//td tdnbsp;/td /tr /c:forEach The iteration is walked through, but no data is displayed. I don't understand why the second implemention doesn't display the data. Can anyone see a problem here/ Thanks, Vernon -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
Re: Using rtexprvalue.
Ooops! Thanks, Stef - Original Message - From: Ryan Lubke [EMAIL PROTECTED] To: Tag Libraries Users List [EMAIL PROTECTED] Sent: Monday, October 21, 2002 12:07 PM Subject: Re: Using rtexprvalue. Hi Stefan, You close tag (c:if) doesn't match the opening tag of (c_rt:if). Change your close tags to match the opening tags. c_rt:if test='%= rtexpr %' Something /c_rt:if -rl On Mon, 2002-10-21 at 12:04, Stefan wrote: Hi, I have a problem using rtexprvalue taglibs and some scripting expressions where some work fine like this one: fmt_rt:formatDate value=%= rs.getDate(lastVisitDate) %/ and others like : c_rt:if test='%=rs.getString(sex)%' Man /c:if c_rt:if test='%=rs.getString(sex)%' Female /c:if gives me errors such as: ' expected at end of file. For XML, the top-level tag must have a matching closing tag I am importing the following two libraries into the pages: %@ taglib prefix='fmt_rt' uri='http://java.sun.com/jstl/fmt_rt' % %@ taglib prefix='c_rt' uri='http://java.sun.com/jstl/core_rt' % In the above examples the JSTL tags are being used inside a while loop that is iterating over a rowset provided by a bean method that has made the database query. Thanks, Stef -- Ryan Lubke [EMAIL PROTECTED] Sun Microsystems, Inc. -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
Re: RE: RE: Why one way works, but not the other?
I FIND THE PROBLEM! It is not mine, but the tag. See the below 10/21/2002 11:10:03 AM, Karr, David [EMAIL PROTECTED] wrote: Inline. -Original Message- From: Vernon Wu [mailto:vernonw;gatewaytech.com] Sent: Monday, October 21, 2002 11:01 AM When you do a view source on the generated page, do you have empty td elements, or an empty table? That will tell you whether there's something wrong with the list, or something wrong with the header item. I don't follow here. In your browser, while viewing your page output, select the menu item to view the HTML source. In the HTML, determine whether the number of tr entries matches the number of items which should be in the list. If this matches, then you should expect to see empty td entries in your tr. If that's the case, there's something wrong with the header/MessageHeader items. If the table is empty, however, then there's something wrong with the list itself. The td fields are empty. I use the script instead as I did in the controller. The data is shown correctly. The code is the followings: % List list = mbox.getList(); for(int i = list.size(); --i = 0;){ MessageHeader header2 = (MessageHeader)list.get(i); % td%=header2.getFrom() %/td td!-- c:out value=${header.from}/ --/td td!-- c:out value=${header.subject}/ --/td tdnbsp;/td /tr !-- /c:forEach -- % } % At the point, I can say the tag doesn't function properly for this case. Is a bug fixed in the most recent release, or I shall not use tag for now? I'm only suggesting doing this to narrow down which part is going wrong, the list, or the items. It could be handy to step through this in your debugger and inspect the session data for these objects. I don't have any JSP debugger. The IDE I use is Eclipse. I don't know any JSP debugger plug-in available. Ok, then set breakpoints in your bean getter/setter methods. When you hit the breakpoints, make sure it's returning (and setting) the data you expect. If you don't hit the breakpoints, then that means something else. As I have said, I don't have any JSP debugger. Thanks for your help, Karr. -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
Re: Special Chars in Param Name
On Mon, 21 Oct 2002, Chen, Gin wrote: Hi all, How can I use jstl when accessing values with special chars in the name? In particular, the period. I have a param that is being passed in as user.name for example. It does not mean name in user object, it just comes from someone declaring fields as: input type=text name=user.name input type=text name=user.email etc.. how about when the special value name is in one of the scopes? I cant do pageScope.user.name i'm assuming. Right, but you can use the '[]' notation, as in ${pageScope[user.name]} If they come directly from a form, then you'll want ${param[user.name]} -- Shawn Bayern JSTL in Action http://www.jstlbook.com -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
Re: Why one way works, but not the other?
Hi, Kris. (I think I get your name right this time). You're absolute right. After I change the name of the variable along with others, it works fine right now. So, the problem is still mine, but not the tag. Thank for your and Karr's help. There are a lot of things to learn along the way to build a Java web application. 10/21/2002 12:59:31 PM, Kris Schneider [EMAIL PROTECTED] wrote: I'm not Karr by the way. In any event, using sessionScope.mbox.list might not have any impact on the output, but my main concern is that you're using the name of a JSTL implicit object in your loop. If what JSTL is really doing with ${header.from} is looking for an HTTP header called from, it definitely will impact your output. Quoting Vernon Wu [EMAIL PROTECTED]: Thanks, Karr. The change, however, shalln't have any impact on the final output, shall it? 10/21/2002 12:33:03 PM, Kris Schneider [EMAIL PROTECTED] wrote: You don't need the jsp:useBean action for JSTL to get at mbox. You can just do: c:forEach var=header items=${sessionScope.mbox.list} varStatus=status header is an implicit object in JSTL, so I'd call your iteration var something else, like hdr. Quoting Vernon Wu [EMAIL PROTECTED]: To illustrate the problem, I provide the following two parts of code/file sample. In a JSP file, I have the followings: jsp:useBean id=agentHelper class=com.xxx.web.client.AgentHelper scope=session / c:set value=${agentHelper.newMembers} var=pageResults / c:forEach var=item items=${pageResults.list} tr td class=TableRowColorc:out value=${item.headline} //td td class=TableRowColor c:url value=search-by-id-action.do var=viewItemURL c:param name=id value=${item.userId}/ /c:url a href='c:out value=${viewItemURL}/' onmouseover=img_on ('signout') onmouseout=img_off('signout') c:out value=${item.userId} / /a /td td class=TableRowColorc:out value=${item.age}//td /tr /c:forEach This page works fine. I use the other implementation method using MVC pattern instead for another page. In the controller, I have the followings: session.setAttribute(mbox, a.openMessageBox(0, 10)); The data is correct at this point. And in the following JSP file I have the followings: jsp:useBean id=mbox class=com.xxx.web.client.model.Page scope=session / c:forEach var=header items=${mbox.list} varStatus=status tr td input type=checkbox name=checkbox value=checkbox /td tdnbsp;/td tdc:out value=${header.from}//td tdc:out value=${header.subject}//td tdnbsp;/td /tr /c:forEach The iteration is walked through, but no data is displayed. I don't understand why the second implemention doesn't display the data. Can anyone see a problem here/ Thanks, Vernon -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
Re: Why one way works, but not the other?
Vernon, You're welcome, glad it's working. Quoting Vernon Wu [EMAIL PROTECTED]: Hi, Kris. (I think I get your name right this time). You're absolute right. After I change the name of the variable along with others, it works fine right now. So, the problem is still mine, but not the tag. Thank for your and Karr's help. There are a lot of things to learn along the way to build a Java web application. 10/21/2002 12:59:31 PM, Kris Schneider [EMAIL PROTECTED] wrote: I'm not Karr by the way. In any event, using sessionScope.mbox.list might not have any impact on the output, but my main concern is that you're using the name of a JSTL implicit object in your loop. If what JSTL is really doing with ${header.from} is looking for an HTTP header called from, it definitely will impact your output. Quoting Vernon Wu [EMAIL PROTECTED]: Thanks, Karr. The change, however, shalln't have any impact on the final output, shall it? 10/21/2002 12:33:03 PM, Kris Schneider [EMAIL PROTECTED] wrote: You don't need the jsp:useBean action for JSTL to get at mbox. You can just do: c:forEach var=header items=${sessionScope.mbox.list} varStatus=status header is an implicit object in JSTL, so I'd call your iteration var something else, like hdr. Quoting Vernon Wu [EMAIL PROTECTED]: To illustrate the problem, I provide the following two parts of code/file sample. In a JSP file, I have the followings: jsp:useBean id=agentHelper class=com.xxx.web.client.AgentHelper scope=session / c:set value=${agentHelper.newMembers} var=pageResults / c:forEach var=item items=${pageResults.list} tr td class=TableRowColorc:out value=${item.headline} //td td class=TableRowColor c:url value=search-by-id-action.do var=viewItemURL c:param name=id value=${item.userId}/ /c:url a href='c:out value=${viewItemURL}/' onmouseover=img_on ('signout') onmouseout=img_off('signout') c:out value=${item.userId} / /a /td td class=TableRowColorc:out value=${item.age}//td /tr /c:forEach This page works fine. I use the other implementation method using MVC pattern instead for another page. In the controller, I have the followings: session.setAttribute(mbox, a.openMessageBox(0, 10)); The data is correct at this point. And in the following JSP file I have the followings: jsp:useBean id=mbox class=com.xxx.web.client.model.Page scope=session / c:forEach var=header items=${mbox.list} varStatus=status tr td input type=checkbox name=checkbox value=checkbox /td tdnbsp;/td tdc:out value=${header.from}//td tdc:out value=${header.subject}//td tdnbsp;/td /tr /c:forEach The iteration is walked through, but no data is displayed. I don't understand why the second implemention doesn't display the data. Can anyone see a problem here/ Thanks, Vernon -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
RE: JSTL for Maps?
This doesn't answer anything Taglib specific but it may give you an idea of ... how to make something that *looks* like a text-box (with CSS?). style type=text/css !-- .readOnlyformField { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: #00; border-color: #66 #CC #CC #66; border-style: solid; border-top-width: 2px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 2px} -- /style ... html:form action=/Action.do table border=0 cellspacing=0 cellpadding=1 tr td class=readOnlyformField bean:write name=Form property=name/ html:hidden name=Form property=name/ /td /tr /table ... /html:form You will notice the I am using Struts also. Be aware the this displays a value on the page and puts it into a box that looks like an html input of type text or input type=text... . The hidden field is used to make the value available in the request when the html form is submitted. I've only tested this technique in IE 5.x, but to that point the use of the readonly attribute in a text field is also an IE only technique. You may want to check out the disabled attribute as well. An important difference between a disabled text field and a readonly text field is that the disabled one is not placed in the request. Also, the CSS style resembles a standard Windows text field. So if the user changes there desktop appearance, or is on a Mac or some browser other than IE, this field may no longer look like the other fields on the page. -Original Message- From: Wendy Smoak [mailto:Wendy.Smoak;asu.edu] Sent: Friday, October 18, 2002 7:56 PM To: 'Tag Libraries Users List' Subject: RE: JSTL for Maps? Section A.3.4 of the specification talks about using the [] operator to access maps. From this, you can see that your EL expression would be ${preferredNames[staffMember]}. If you're using Struts-EL, you can just use that as your value value on your html-el:text element. I can't use the html-el tag for this, because then Struts wants to pre-populate the text box and will complain that there are no getJunk/getJunk methods in my ActionForm. If I could figure out how to make something that *looks* like a text-box (with CSS?), I'd do that instead. But lacking that knowledge, a read-only text box is what I'm using. Thanks for the syntax help. Looks like I need the c:out tag: input type=text name=junk readonly=readonly size=50 value=c:out value=${preferredNames[staffMember]}// (This is starting to look like Perl!) -- Wendy Smoak http://sourceforge.net/projects/unidbtags -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org