RE: PLEASE HELP - struts-tiles no longer work
The debug code below returned the correct paths to JSP pages for header, body, rightside and footer, but none of them get displayed. It returns a blank page. %=request.getContextPath()%tiles:getAsString name=header /BR %=request.getContextPath()%tiles:getAsString name=body /BR %=request.getContextPath()%tiles:getAsString name=rightSide /BR %=request.getContextPath()%tiles:getAsString name=footer /BR Thanks! Tuan -Original Message- From: Tuan H. Le Sent: Friday, October 18, 2002 8:41 PM To: Struts Users Mailing List (E-mail) Subject: PLEASE HELP - struts-tiles no longer work Hi, My app was working fine using struts-tiles with frameset. But since this afternoon, it does not work any more. It displays a blank page (NOT a 404 error). I have tried with debug code, but couldn't figure out. The action forward seems to work fine after the user login. I tested and it forwarded to the right View (JSP) which is the MainMenu.jsp. I have been debugging this issue for the last 5 hrs, and I ran out of idea where to look for a solution to this problem. Please help! Thanks, Tuan ** MainMenu.jsp *** % page import=com.phs.ezhr.constant.IConstants % % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % // get the user's selected navigation String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY ); String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY ); % % if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { % tiles:insert definition=summaryLayout flush=true / % } ** Layout.jsp % page language=java % % taglib uri=/WEB-INF/struts-html.tld prefix=html % % taglib uri=/WEB-INF/struts-bean.tld prefix=bean % % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % taglib uri=/WEB-INF/struts-logic.tld prefix=logic % % page import=com.phs.ezhr.constant.IConstants % % // get the user's selected navigation String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY ); String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY ); // set the frameset row heights for each tab header String rh1 = null; String rh2 = *; String rh3 = null; String cw1 = null; String cw2 = *; if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { rh1 = 99; rh3 = 55; cw1 = 95%; } else if ( selTab == IConstants.SALARY_TAB ) { rh1 = 201; rh3 = 125; cw1 = 97%; } else if ( selTab == IConstants.BONUS_TAB ) { rh1 = 229; rh3 = 125; cw1 = 95%; } % !-- FOR DEBUG PURPOSE ONLY == GOT CORRECT DATA RETURNED HERE -- %=request.getContextPath()%tiles:getAsString name=header /BR %=request.getContextPath()%tiles:getAsString name=body /BR %=request.getContextPath()%tiles:getAsString name=rightSide /BR %=request.getContextPath()%tiles:getAsString name=footer /BR Select Tab = %= selTab %BR !-- END DEBUG -- !-- frame -- html:html HEAD html:base/ TITLEbean:message key=app.label.title //TITLE /HEAD frameset rows=%=rh1%,%=rh2%,%=rh3% frameborder=0 noresize framespacing=0 frame src='%=request.getContextPath()%tiles:getAsString name=header/' name=header id=top frameborder=0 scrolling=no noresize marginwidth=0 marginheight=0 framespacing=0 frameset cols=%=cw1%,%=cw2% framespacing=0 frame src='%=request.getContextPath()%tiles:getAsString name=body/' name=body marginwidth=0 marginheight=0 scrolling=yes frameborder=0 noresize framespacing=0 frame src='%=request.getContextPath()%tiles:getAsString name=rightSide/' name=rightSide marginwidth=10 marginheight=10 scrolling=no frameborder=0 noresize framespacing=0 /frameset frame src='%=request.getContextPath()%tiles:getAsString name=footer/' name=footer id=bottom frameborder=0 scrolling=no marginwidth=0 marginheight=0 noresize framespacing=0 /frameset noframes bean:message key=app.msg.noframe / /noframes /html:html *** tiles-definitions.xml * ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration//EN http://jakarta.apache.org/struts/dtds/tiles-config.dtd; !-- Definitions for Tiles documentation -- tiles-definitions !-- === -- !-- Master definition -- !-- === -- definition name=summaryLayout path=/Layout.jsp put name=title value=Online Focal Tool Application/ put name=header value=/Header.jsp/ put name=footer value=/Footer.jsp/ put name=body value=/ManagerSummaryContent.jsp/ put name=rightSide
Re: PLEASE HELP - struts-tiles no longer work
Why don't you look at the source? My guess is that if you are looking at a blank page, the page, except for tags, is blank. At 08:41 PM 10/18/2002 -0700, you wrote: Hi, My app was working fine using struts-tiles with frameset. But since this afternoon, it does not work any more. It displays a blank page (NOT a 404 error). I have tried with debug code, but couldn't figure out. The action forward seems to work fine after the user login. I tested and it forwarded to the right View (JSP) which is the MainMenu.jsp. I have been debugging this issue for the last 5 hrs, and I ran out of idea where to look for a solution to this problem. Please help! Thanks, Tuan ** MainMenu.jsp *** % page import=com.phs.ezhr.constant.IConstants % % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % // get the user's selected navigation String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY ); String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY ); % % if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { % tiles:insert definition=summaryLayout flush=true / % } ** Layout.jsp % page language=java % % taglib uri=/WEB-INF/struts-html.tld prefix=html % % taglib uri=/WEB-INF/struts-bean.tld prefix=bean % % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % taglib uri=/WEB-INF/struts-logic.tld prefix=logic % % page import=com.phs.ezhr.constant.IConstants % % // get the user's selected navigation String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY ); String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY ); // set the frameset row heights for each tab header String rh1 = null; String rh2 = *; String rh3 = null; String cw1 = null; String cw2 = *; if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { rh1 = 99; rh3 = 55; cw1 = 95%; } else if ( selTab == IConstants.SALARY_TAB ) { rh1 = 201; rh3 = 125; cw1 = 97%; } else if ( selTab == IConstants.BONUS_TAB ) { rh1 = 229; rh3 = 125; cw1 = 95%; } % !-- FOR DEBUG PURPOSE ONLY == GOT CORRECT DATA RETURNED HERE -- %=request.getContextPath()%tiles:getAsString name=header /BR %=request.getContextPath()%tiles:getAsString name=body /BR %=request.getContextPath()%tiles:getAsString name=rightSide /BR %=request.getContextPath()%tiles:getAsString name=footer /BR Select Tab = %= selTab %BR !-- END DEBUG -- !-- frame -- ' name=header id=top frameborder=0 scrolling=no noresize marginwidth=0 marginheight=0 framespacing=0 ' name=body marginwidth=0 marginheight=0 scrolling=yes frameborder=0 noresize framespacing=0 ' name=rightSide marginwidth=10 marginheight=10 scrolling=no frameborder=0 noresize framespacing=0 ' name=footer id=bottom frameborder=0 scrolling=no marginwidth=0 marginheight=0 noresize framespacing=0 *** tiles-definitions.xml * ?xml version=1.0 encoding=ISO-8859-1 ? -- To unsubscribe, e-mail: For additional commands, e-mail: Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: PLEASE HELP - struts-tiles no longer work
I don't know, but my guess is that you meant to use someString.equals(someOtherString) rather than someString == someOtherString, unless you somehow are using a hidden myString.intern() in there. My guess, in other words, is that you are getting nothing because all your == tests yield false. Try sticking a ! or two in there and see if something miraculously appears. Debuggers are not very clever at finding the real problems, like this one, if this is right. At 12:03 AM 10/19/2002 -0700, you wrote: Why don't you look at the source? My guess is that if you are looking at a blank page, the page, except for tags, is blank. At 08:41 PM 10/18/2002 -0700, you wrote: Hi, My app was working fine using struts-tiles with frameset. But since this afternoon, it does not work any more. It displays a blank page (NOT a 404 error). I have tried with debug code, but couldn't figure out. The action forward seems to work fine after the user login. I tested and it forwarded to the right View (JSP) which is the MainMenu.jsp. I have been debugging this issue for the last 5 hrs, and I ran out of idea where to look for a solution to this problem. Please help! Thanks, Tuan ** MainMenu.jsp *** % page import=com.phs.ezhr.constant.IConstants % % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % // get the user's selected navigation String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY ); String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY ); % % if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { % tiles:insert definition=summaryLayout flush=true / % } ** Layout.jsp % page language=java % % taglib uri=/WEB-INF/struts-html.tld prefix=html % % taglib uri=/WEB-INF/struts-bean.tld prefix=bean % % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % taglib uri=/WEB-INF/struts-logic.tld prefix=logic % % page import=com.phs.ezhr.constant.IConstants % % // get the user's selected navigation String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY ); String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY ); // set the frameset row heights for each tab header String rh1 = null; String rh2 = *; String rh3 = null; String cw1 = null; String cw2 = *; if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { rh1 = 99; rh3 = 55; cw1 = 95%; } else if ( selTab == IConstants.SALARY_TAB ) { rh1 = 201; rh3 = 125; cw1 = 97%; } else if ( selTab == IConstants.BONUS_TAB ) { rh1 = 229; rh3 = 125; cw1 = 95%; } % !-- FOR DEBUG PURPOSE ONLY == GOT CORRECT DATA RETURNED HERE -- %=request.getContextPath()%tiles:getAsString name=header /BR %=request.getContextPath()%tiles:getAsString name=body /BR %=request.getContextPath()%tiles:getAsString name=rightSide /BR %=request.getContextPath()%tiles:getAsString name=footer /BR Select Tab = %= selTab %BR !-- END DEBUG -- !-- frame -- ' name=header id=top frameborder=0 scrolling=no noresize marginwidth=0 marginheight=0 framespacing=0 ' name=body marginwidth=0 marginheight=0 scrolling=yes frameborder=0 noresize framespacing=0 ' name=rightSide marginwidth=10 marginheight=10 scrolling=no frameborder=0 noresize framespacing=0 ' name=footer id=bottom frameborder=0 scrolling=no marginwidth=0 marginheight=0 noresize framespacing=0 *** tiles-definitions.xml * ?xml version=1.0 encoding=ISO-8859-1 ? -- To unsubscribe, e-mail: For additional commands, e-mail: Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the
PLEASE HELP - struts-tiles no longer work
Hi, My app was working fine using struts-tiles with frameset. But since this afternoon, it does not work any more. It displays a blank page (NOT a 404 error). I have tried with debug code, but couldn't figure out. The action forward seems to work fine after the user login. I tested and it forwarded to the right View (JSP) which is the MainMenu.jsp. I have been debugging this issue for the last 5 hrs, and I ran out of idea where to look for a solution to this problem. Please help! Thanks, Tuan ** MainMenu.jsp *** % page import=com.phs.ezhr.constant.IConstants % % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % // get the user's selected navigation String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY ); String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY ); % % if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { % tiles:insert definition=summaryLayout flush=true / % } ** Layout.jsp % page language=java % % taglib uri=/WEB-INF/struts-html.tld prefix=html % % taglib uri=/WEB-INF/struts-bean.tld prefix=bean % % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % taglib uri=/WEB-INF/struts-logic.tld prefix=logic % % page import=com.phs.ezhr.constant.IConstants % % // get the user's selected navigation String selTab = (String)session.getAttribute( IConstants.USER_SEL_TAB_KEY ); String selSubTab = (String)session.getAttribute( IConstants.USER_SEL_SUBTAB_KEY ); // set the frameset row heights for each tab header String rh1 = null; String rh2 = *; String rh3 = null; String cw1 = null; String cw2 = *; if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { rh1 = 99; rh3 = 55; cw1 = 95%; } else if ( selTab == IConstants.SALARY_TAB ) { rh1 = 201; rh3 = 125; cw1 = 97%; } else if ( selTab == IConstants.BONUS_TAB ) { rh1 = 229; rh3 = 125; cw1 = 95%; } % !-- FOR DEBUG PURPOSE ONLY == GOT CORRECT DATA RETURNED HERE -- %=request.getContextPath()%tiles:getAsString name=header /BR %=request.getContextPath()%tiles:getAsString name=body /BR %=request.getContextPath()%tiles:getAsString name=rightSide /BR %=request.getContextPath()%tiles:getAsString name=footer /BR Select Tab = %= selTab %BR !-- END DEBUG -- !-- frame -- html:html HEAD html:base/ TITLEbean:message key=app.label.title //TITLE /HEAD frameset rows=%=rh1%,%=rh2%,%=rh3% frameborder=0 noresize framespacing=0 frame src='%=request.getContextPath()%tiles:getAsString name=header/' name=header id=top frameborder=0 scrolling=no noresize marginwidth=0 marginheight=0 framespacing=0 frameset cols=%=cw1%,%=cw2% framespacing=0 frame src='%=request.getContextPath()%tiles:getAsString name=body/' name=body marginwidth=0 marginheight=0 scrolling=yes frameborder=0 noresize framespacing=0 frame src='%=request.getContextPath()%tiles:getAsString name=rightSide/' name=rightSide marginwidth=10 marginheight=10 scrolling=no frameborder=0 noresize framespacing=0 /frameset frame src='%=request.getContextPath()%tiles:getAsString name=footer/' name=footer id=bottom frameborder=0 scrolling=no marginwidth=0 marginheight=0 noresize framespacing=0 /frameset noframes bean:message key=app.msg.noframe / /noframes /html:html *** tiles-definitions.xml * ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration//EN http://jakarta.apache.org/struts/dtds/tiles-config.dtd; !-- Definitions for Tiles documentation -- tiles-definitions !-- === -- !-- Master definition -- !-- === -- definition name=summaryLayout path=/Layout.jsp put name=title value=Online Focal Tool Application/ put name=header value=/Header.jsp/ put name=footer value=/Footer.jsp/ put name=body value=/ManagerSummaryContent.jsp/ put name=rightSide value=/RightSide.jsp / /definition /tiles-definitions winmail.dat-- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
options not showing
Hi, The code below is a copy of the example of the html select tag. Vector wanGroupOptions = new Vector(); wanGroupOptions.add( new LabelValueBean( Label 0, Value 0 )); wanGroupOptions.add( new LabelValueBean( Label 1, Value 1 )); Now the following works but generates empty options tags. html:select property=wanGroups size=1 html:options collection=wanGroupOptions property=value labelProperty=label/ /html:select I am using the following code to debug and I am getting the correct size printed on the screen. jsp:useBean id=wanGroupOptions class=java.util.Vector scope=application/ %= wanGroupOptions.size() % What could be the problem ? Any ideas are appreciated ? bye, Mohan This message and any attachments have been scanned for viruses during transmission from HCL Comnet. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: options not showing
You are not alone, my frustrated brotha'. I've done this before and I was pulling my hair out trying to figure out just what the heck was going on. Glad you resolved it :) robert -Original Message- From: Mohan Radhakrishnan [mailto:MohanR;hclcomnet.co.in] Sent: Saturday, October 19, 2002 6:08 AM To: '[EMAIL PROTECTED]' Subject: options not showing Hi, Answering my own question. The LabelValueBean was coded like this. That was the problem. private String label = null; private String value = null; public LabelValueBean(String label, String value) { label = label; -- No this value = value; } The code below is a copy of the example of the html select tag. Vector wanGroupOptions = new Vector(); wanGroupOptions.add( new LabelValueBean( Label 0, Value 0 )); wanGroupOptions.add( new LabelValueBean( Label 1, Value 1 )); Now the following works but generates empty options tags. html:select property=wanGroups size=1 html:options collection=wanGroupOptions property=value labelProperty=label/ /html:select I am using the following code to debug and I am getting the correct size printed on the screen. jsp:useBean id=wanGroupOptions class=java.util.Vector scope=application/ %= wanGroupOptions.size() % What could be the problem ? Any ideas are appreciated ? -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Problem using logic:notEmpty
Hi all, I want to display a user 'age' if it is not empty. I've tried the following code but it gives the exception : javax.servlet.ServletException: You must specify the value attribute or nested tag content What could be the reason for this? The code is: logic:iterate id=user name=resList tr td class=commonFont html:multibox property=selectedUser bean:write name=user property=userName/ logic:notEmpty name=user property=age bean:write name=user property=age/ /logic:notEmpty /html:multibox /td td class=standard bean:write name=user property=userName// bean:write name=user property=age/ /td /tr /logic:iterate Regards, Vinod -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
multibox, checkbox
Hello agaaain, My checkboxes both multi and normal don't suppo all empty values. I.e. I can transmit a checked empty value, but I can't all empty values: I REALLY don't know what to do ... leease! --useredit_center.jsp-- %taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %taglib uri=/WEB-INF/struts-html.tld prefix=html % %taglib uri=/WEB-INF/struts-logic.tld prefix=logic % %taglib uri=/WEB-INF/c.tld prefix=c % c:set var='jspPrincipalId' value='${sessionScope.userEditForm.principalId}'/ c:set var=jspAllGroups value=${sessionScope.userEditForm.allGroups}/ html:form action=/userPostChanges table class='edit' cellpadding=0 cellspacing='0' tbody tr c:if test=${jspPrincipalId != null} tdbean:message key=label.login//td td c:out value=${jspPrincipalId}/ html:hidden property=principalId/ /td /c:if c:if test=${jspPrincipalId == null} tdbean:message key=label.login//td td width='100%' html:text property=principalId size=50 maxlength=255/ /td /c:if /tr tr tdbean:message key=label.passwd1//td td width='100%' html:password property=passwd1 size=50 maxlength=255/ /td /tr tr tdbean:message key=label.passwd2//td td width='100%' html:password property=passwd2 size=50 maxlength=255/ /td /tr tr tdbean:message key=label.surname//td td width='100%' html:text property=name1 size=50 maxlength=255/ /td /tr tr tdbean:message key=label.name//td td width='100%' html:text property=name2 size=50 maxlength=255/ /td /tr tr tdbean:message key=label.cf//td td width='100%' html:text property=cf size=50 maxlength=16/ /td /tr tr tdbean:message key=label.piva//td td width='100%' html:text property=piva size=50 maxlength=13/ /td /tr tr tdbean:message key=label.address//td td width='100%' html:text property=address size=50 maxlength=255/ /td /tr tr tdbean:message key=label.zip//td td width='100%' html:text property=zip size=50 maxlength=10/ /td /tr tr tdbean:message key=label.city//td td width='100%' html:text property=city size=50 maxlength=255/ /td /tr tr tdbean:message key=label.state//td td width='100%' html:text property=state size=50 maxlength=255/ /td /tr tr tdbean:message key=label.country//td td width='100%' html:text property=country size=50 maxlength=255/ /td /tr tr tdbean:message key=label.phone//td td width='100%' html:text property=tel size=50 maxlength=255/ /td /tr tr tdbean:message key=label.mailaddress//td td width='100%' html:text property=mail size=50 maxlength=255/ /td /tr tr tdbean:message key=label.website//td td width='100%' html:text property=web size=50 maxlength=255/
Re: multibox, checkbox PROBLEM FOUND, SOLUTION NOT!!!
Ok suppose to have a Form with a checkbox named isOn and a submit button name Save a NOT checked value will produce: http://localhost:8080/webappointments/openChk.do?action=Save a checked value will produce: http://localhost:8080/webappointments/openChk.do?isOn=onaction=Save The problem is that if I have a checked value that I want to turn off I'll send http://localhost:8080/webappointments/openChk.do?action=Save the form function public void setIsOn( boolean isOn ) { this.isOn = isOn; } is not called and the value will not be changed. Where am I wrong ?? kiuma wrote: Hello agaaain, My checkboxes both multi and normal don't suppo all empty values. I.e. I can transmit a checked empty value, but I can't all empty values: I REALLY don't know what to do ... leease! --useredit_center.jsp-- %taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %taglib uri=/WEB-INF/struts-html.tld prefix=html % %taglib uri=/WEB-INF/struts-logic.tld prefix=logic % %taglib uri=/WEB-INF/c.tld prefix=c % c:set var='jspPrincipalId' value='${sessionScope.userEditForm.principalId}'/ c:set var=jspAllGroups value=${sessionScope.userEditForm.allGroups}/ html:form action=/userPostChanges table class='edit' cellpadding=0 cellspacing='0' tbody tr c:if test=${jspPrincipalId != null} tdbean:message key=label.login//td td c:out value=${jspPrincipalId}/ html:hidden property=principalId/ /td /c:if c:if test=${jspPrincipalId == null} tdbean:message key=label.login//td td width='100%' html:text property=principalId size=50 maxlength=255/ /td /c:if /tr tr tdbean:message key=label.passwd1//td td width='100%' html:password property=passwd1 size=50 maxlength=255/ /td /tr tr tdbean:message key=label.passwd2//td td width='100%' html:password property=passwd2 size=50 maxlength=255/ /td /tr tr tdbean:message key=label.surname//td td width='100%' html:text property=name1 size=50 maxlength=255/ /td /tr tr tdbean:message key=label.name//td td width='100%' html:text property=name2 size=50 maxlength=255/ /td /tr tr tdbean:message key=label.cf//td td width='100%' html:text property=cf size=50 maxlength=16/ /td /tr tr tdbean:message key=label.piva//td td width='100%' html:text property=piva size=50 maxlength=13/ /td /tr tr tdbean:message key=label.address//td td width='100%' html:text property=address size=50 maxlength=255/ /td /tr tr tdbean:message key=label.zip//td td width='100%' html:text property=zip size=50 maxlength=10/ /td /tr tr tdbean:message key=label.city//td td width='100%' html:text property=city size=50 maxlength=255/ /td /tr tr tdbean:message key=label.state//td td width='100%' html:text property=state size=50 maxlength=255/ /td /tr tr tdbean:message key=label.country//td td width='100%' html:text property=country size=50 maxlength=255/ /td /tr tr tdbean:message key=label.phone//td td width='100%'
RE: multibox, checkbox PROBLEM FOUND, SOLUTION NOT!!!
I'm coming into this discussion late, so ignore me if I'm out in left field, but it sounds like you're unhappy that when *no* checkboxes are checked, *no* methods get called. When you submit the form, only successful form elements are sent in the request, so if *no* checkboxes are checked, *nothing* related to those checkboxes will be present in the request. Isn't this what the reset method is all about? The reset method will be called before Struts automagically populates all of your ActionForm fields. I can't tell what your Collection is from this post, but try clearing out *all* of the values in the Collection that handles your checkboxes in the reset() method of the Form. Then, if you uncheck all of the boxes and submit, you should see that none of them are checked when the form is redisplayed (or you use the data). Hope that helps, -- Wendy Smoak Arizona State University PA IRM
Re: multibox, checkbox PROBLEM FOUND, SOLUTION NOT!!!
Thanks a lot , you have been very clarifying. I've found a tip placing code in validate method : public ActionErrors validate( ActionMapping mapping, HttpServletRequest req) { String str = req.getParameter( isOn ); if (str == null) isOn = false; return null; } But it's a very dirty technique of course. Wendy Smoak wrote: I'm coming into this discussion late, so ignore me if I'm out in left field, but it sounds like you're unhappy that when *no* checkboxes are checked, *no* methods get called. When you submit the form, only successful form elements are sent in the request, so if *no* checkboxes are checked, *nothing* related to those checkboxes will be present in the request. Isn't this what the reset method is all about? The reset method will be called before Struts automagically populates all of your ActionForm fields. I can't tell what your Collection is from this post, but try clearing out *all* of the values in the Collection that handles your checkboxes in the reset() method of the Form. Then, if you uncheck all of the boxes and submit, you should see that none of them are checked when the form is redisplayed (or you use the data). Hope that helps, -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: AW: BeanUtils.copyProperties(formBean, javaBean) not converting S trin g dates to java.util.Date dates
Hi, Struts1.1b2: BeanUtils.copyProperties(formBean, javaBean) not converting String properties into Dates: It will not covert them into java.util.Date. You need to create a Converter class to do it an register it. I just went through all this with Eldercle who posted to this list as well. The solution that works is below. Just create the two classes below and register them in the action like I do below and you should be all set. Let me know if you have any questions. To use these converters so that BeanUtils.copyProperties( ) works in both directions I just added a static block to the top of my dispatch Action ... static { DateBeanUtilsConverter dateConverter = new DateBeanUtilsConverter(); dateConverter.setFormatPattern( MMdd ); StringBeanUtilsConverterDate myStringConverter = new StringBeanUtilsConverterDate(); myStringConverter.setFormatPattern( MMdd ); ConvertUtils.register( dateConverter, java.util.Date.class ); ConvertUtils.register( myStringConverter, String.class ); } The two classes are listed below. All seems to be working fine. /** coverts java.util.Date to String using BeanUtils ***/ import org.apache.commons.beanutils.Converter; import java.text.*; import java.util.*; import corporate.*; public class DateBeanUtilsConverter implements Converter { private String formatPattern = null; public void setFormatPattern(String formatPattern) { this.formatPattern = formatPattern; } public Object convert(Class type, Object value) { Date date = null; if (value != null (value instanceof String) (type == Date.class)) { try { String s = value.toString(); SimpleDateFormat formatter = new SimpleDateFormat(formatPattern); date = formatter.parse(s); } catch (Exception e) { ErrorLogging.println(DateBeanUtilsConverter: + e); } } return date; } } /** coverts String to java.util.Date using BeanUtils ***/ import org.apache.commons.beanutils.Converter; import org.apache.commons.beanutils.converters.*; import java.text.*; import java.util.*; import corporate.*; public class StringBeanUtilsConverterDate implements Converter { private static final StringConverter stringConverter = new StringConverter(); private String formatPattern = null; public void setFormatPattern(String formatPattern) { this.formatPattern = formatPattern; } public Object convert(Class type, Object value) { Object returnValue = null; if (value != null) { if (type == String.class (value instanceof Date)) { SimpleDateFormat formatter = new SimpleDateFormat(formatPattern); String dateString = formatter.format(value); returnValue = dateString; } else { returnValue = stringConverter.convert(type, value); } } return returnValue; } } -- Rick mailto:maillist;reumann.net -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: multibox, checkbox PROBLEM FOUND, SOLUTION NOT!!!
Kiuma wrote: I've found a tip placing code in validate method : But it's a very dirty technique of course. That will work, but... what if you have a form that you don't want to validate? The reason this is working is that you have validate set to true so that the validate method gets called. If you set validate to false, it'll stop working. One line in your reset method will do the same thing: isOn = false; The reset method will autmatically get called before the set-methods for the successful form elements. So if the checkbox isn't checked, the isOn property will remain false. If it is checked, then the setIsOn method will be called and isOn will be set to true. For the sake of the person who has to maintain your code later on, (not to mention your own sanity when you look at this in six months,) use the validate and reset methods for their intended purposes. :) -- Wendy Smoak Arizona State University IA IRM
[LazyCollections] Anyone else using this?
Greetings: I am just starting to use this Class from commons.collections jar that is in Struts 1.1b2 ( I am using tomcat 4.04) I have several questions... 1- Is there anyone out there using this collection that can share some insight? 2 - There was talk of a tutorial regarding this utility, but I cannot find one in jakarta commons or keyboardmonkey.com. Does one exist? I have read (I think) all the posts in the archive regarding this. 3 - I am in the process of implementing a standard dynamic list of value objects on a page that have several columns that are editable. I have it working for the most part but I have one *odd* issue. When I submit the form, the list gets populated as it should but with one extra value bean. USAGE: My form Bean contains the property: private List papVoList = LazyCollections.lazyList(new ArrayList(),PapVoViewBean.class); I use the nested tags to render the table on the page. In my loadAction I send a standard java.util.List from the backend (which is probably a Vector); List myList = businessService.getPapVoList(); myForm.setPapVoList(myList); *** By doing this I guess the initialized LazyList in the form bean is replaced with a standard List just for the loading of the page. but when the form is submitted, I assume a new request scope form bean is created. ( if not the list would not be populated at all) Am I setting things up correctly? Sorry for the Rambling, but here are some of the things I have observed: A list of 20 goes onto the page and a list of 21 get created upon submit. ** The new** object has property with a value from the last legitimate object in the list. Example: vo[0]: amount=111 ,date=111 vo[1]: amount=222,date=222 ... vo[19]: amount=999,date=999 vo[20]: amount=999,date=null (Extra object) I do not understand why amt has a value but date does not. I have verified that the control names are correct on the page . Example: FROM papVoList[0].papDateTO papVoList[19].papDate and no more. I have printed the parameter names and values directly from the request and found no stray parameters. Another odd thing is that I tried to use the LazyCollections.clean(List) method(I didn't think I would need to) , it would produce yet another blank object to end of the list. List myList = myForm.getMyList(); myList.size(): 21 LazyCollections.clean(myList) myList.size(): 22 -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
i18n messages in javascript js file
My application uses javascript validations (at the client side) and all the validations are done in a validate.js file and displays the error messages with alerts. And all the messages in the javascript are hardcoded and the js file is used in many jsp's. Can i make the messages internationalized using struts frames work? if yes how can i do that ? thanks in advance. sridhar
Re: i18n messages in javascript js file
I think this works fine for u JS Function function _alert(key) { var url=/app/view/jsp/Alert.jsp?name=+key; window.showModalDialog(url,null,'dialogHeight:120px;dialogWidth:400px;scroll:no;status:no'); return false; } Alert.jsp % String _key=null; if(request.getParameter(name)!=null) _key=request.getParameter(name); % bean:message key=%= _key % locale=app_sitelanguage / Just pass the key as a parameter for the function _alert(key) where u can get this key from property file Regards Varma - Original Message - From: sridhar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, October 19, 2002 11:51 PM Subject: i18n messages in javascript js file My application uses javascript validations (at the client side) and all the validations are done in a validate.js file and displays the error messages with alerts. And all the messages in the javascript are hardcoded and the js file is used in many jsp's. Can i make the messages internationalized using struts frames work? if yes how can i do that ? thanks in advance. sridhar -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: i18n messages in javascript js file
I think this works fine for u JS Function function _alert(key) var url=/app/view/jsp/Alert.jsp?name=+key; window.showModalDialog(url,null,'dialogHeight:120px;dialogWidth:400px;scroll :no;status:no'); return false; } Alert.jsp % String _key=null; if(request.getParameter(name)!=null) _key=request.getParameter(name); % bean:message key=%= _key % locale=app_sitelanguage / Just pass the key as a parameter for the function _alert(key) where u can get this key from property file Regards Varma - Original Message - From: sridhar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, October 19, 2002 11:51 PM Subject: i18n messages in javascript js file My application uses javascript validations (at the client side) and all the validations are done in a validate.js file and displays the error messages with alerts. And all the messages in the javascript are hardcoded and the js file is used in many jsp's. Can i make the messages internationalized using struts frames work? if yes how can i do that ? thanks in advance. sridhar -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: [LazyCollections] Anyone else using this? - Found some answers....LazyCollectionsgone
I managed to make my issues go away by replacing my commons-collections(2.0) jar with the Release Candidate 2.1 version. It also seems that some of the functionality of LazyCollections has been absorbed into ListUtils. so I replaced private List papVoList = LazyCollections.lazyList(new ArrayList (),PapVoViewBean.class) with: private List papVoList = ListUtils.lazyList(new ArrayList(), new Factory(){ public Object create(){ return new PapVoViewBean(); } }); It appears to work, so I am happy :) I peeked into the struts nightly binary and it appears that commons-collection 2.1 is what is shipped. QUESTION: Is it safe to replace the commons-collection 2.0 jar with 2.1 at this time? or should I wait. Is there another way to get this functionality without upsetting our release packages? [EMAIL PROTECTED] on 10/19/2002 01:01:01 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To:[EMAIL PROTECTED] cc: Subject:[LazyCollections] Anyone else using this? Greetings: I am just starting to use this Class from commons.collections jar that is in Struts 1.1b2 ( I am using tomcat 4.04) I have several questions... 1- Is there anyone out there using this collection that can share some insight? 2 - There was talk of a tutorial regarding this utility, but I cannot find one in jakarta commons or keyboardmonkey.com. Does one exist? I have read (I think) all the posts in the archive regarding this. 3 - I am in the process of implementing a standard dynamic list of value objects on a page that have several columns that are editable. I have it working for the most part but I have one *odd* issue. When I submit the form, the list gets populated as it should but with one extra value bean. USAGE: My form Bean contains the property: private List papVoList = LazyCollections.lazyList(new ArrayList (),PapVoViewBean.class); I use the nested tags to render the table on the page. In my loadAction I send a standard java.util.List from the backend (which is probably a Vector); List myList = businessService.getPapVoList(); myForm.setPapVoList(myList); *** By doing this I guess the initialized LazyList in the form bean is replaced with a standard List just for the loading of the page. but when the form is submitted, I assume a new request scope form bean is created. ( if not the list would not be populated at all) Am I setting things up correctly? Sorry for the Rambling, but here are some of the things I have observed: A list of 20 goes onto the page and a list of 21 get created upon submit. ** The new** object has property with a value from the last legitimate object in the list. Example: vo[0]: amount=111 ,date=111 vo[1]: amount=222,date=222 ... vo[19]: amount=999,date=999 vo[20]: amount=999,date=null (Extra object) I do not understand why amt has a value but date does not. I have verified that the control names are correct on the page . Example: FROM papVoList[0].papDateTO papVoList[19].papDate and no more. I have printed the parameter names and values directly from the request and found no stray parameters. Another odd thing is that I tried to use the LazyCollections.clean(List) method(I didn't think I would need to) , it would produce yet another blank object to end of the list. List myList = myForm.getMyList(); myList.size(): 21 LazyCollections.clean(myList) myList.size(): 22 -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Role bean
Dear people, I know I am probably being stupid again but I can't figure this: I am not currently using container managed security and do intend to switch eventually but, for the moment, I would like to be able to set the user role programmatically from within my app. I found Ted's advice below: http://husted.com/struts/catalog.html== For customized security, place a role bean in session for access by custom tags and other resources The standard security model is exposed through methods on the RequestUtils bean. If your security system is not fully integrated with the standard model, provide your own bean in the session with similar methods, or extend the ActionController to add this bean to each request. Custom tags, like those provided by the Jakarta Tagibs request library, can then access your bean instead of the standard RequestUtil bean. == This seems perfect except I can't find the bean Ted is talking about: RequestUtils in the Tomcat 4.1.12 source doesn't seem to refer to roles at all. I checked the Taglibs source and the isUserInRole method just does the obvious: calls isUserInRole() on the request. Can anyone show me how to do it? Thanks Alan P. Sexton, University of Birmingham School of Computer Science Edgbaston, Birmingham B15 2TT, England -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
JDK 1.4 and struts
There were a couple of messages the other day concerning Struts failing to work correctly under the 1.4 JDK. I'd like to add some evidence to that. Sun's 1.4 JDK (at least the Linux version) seems to have serious problems w/ the classpath. After upgrading to 1.4.0_01, and then 1.4.1_01, Struts no longer works on my machine. Specifically, when dispatching to an Action subclass, the JVM cannot seem to find org.apache.struts.action.Action -- despite knowing all about ActionServlet and a bunch of other classes in the struts.jar file. Someone stated recently that Struts DOES WORK w/ JDK1.4. Which OS is that? And does anyone have positive experience using Struts w/ JDK1.4 on Linux? --- John Byrd [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: JDK 1.4 and struts
Struts works under Sun's 1.4 jdk on Windows 2000. I haven't tried it on Linux though. You might try using IBM's 1.4 jdk. David From: email [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: JDK 1.4 and struts Date: Sat, 19 Oct 2002 20:21:23 -0400 There were a couple of messages the other day concerning Struts failing to work correctly under the 1.4 JDK. I'd like to add some evidence to that. Sun's 1.4 JDK (at least the Linux version) seems to have serious problems w/ the classpath. After upgrading to 1.4.0_01, and then 1.4.1_01, Struts no longer works on my machine. Specifically, when dispatching to an Action subclass, the JVM cannot seem to find org.apache.struts.action.Action -- despite knowing all about ActionServlet and a bunch of other classes in the struts.jar file. Someone stated recently that Struts DOES WORK w/ JDK1.4. Which OS is that? And does anyone have positive experience using Struts w/ JDK1.4 on Linux? --- John Byrd [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Unlimited Internet access for only $21.95/month. Try MSN! http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: JDK 1.4 and struts
Problem is, IBM doesn't HAVE a 1.4 for Intel machines. Struts works under Sun's 1.4 jdk on Windows 2000. I haven't tried it on Linux though. You might try using IBM's 1.4 jdk. David From: email [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: JDK 1.4 and struts Date: Sat, 19 Oct 2002 20:21:23 -0400 There were a couple of messages the other day concerning Struts failing to work correctly under the 1.4 JDK. I'd like to add some evidence to that. Sun's 1.4 JDK (at least the Linux version) seems to have serious problems w/ the classpath. After upgrading to 1.4.0_01, and then 1.4.1_01, Struts no longer works on my machine. Specifically, when dispatching to an Action subclass, the JVM cannot seem to find org.apache.struts.action.Action -- despite knowing all about ActionServlet and a bunch of other classes in the struts.jar file. Someone stated recently that Struts DOES WORK w/ JDK1.4. Which OS is that? And does anyone have positive experience using Struts w/ JDK1.4 on Linux? --- John Byrd [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Unlimited Internet access for only $21.95/month. Try MSN! http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- John Byrd [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org