Grokbase
x

Struts Newsgroup (@Basebeans.com) (s...@basebeans.com)

Profile | Posts (3)

User Information

Display Name:Struts Newsgroup (@Basebeans.com)
Partial Email Address:s...@basebeans.com
Posts:
3 total
3 in struts-user@jakarta.apache.org

5 Most Recent

1) Struts Newsgroup (@Basebeans.com) reload the current page?
| +1 vote
Subject: reload the current page? From: "David Chu" <davidchu@aol.net> Given that I am in an...
struts-user@jakarta.apache.org
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Subject: reload the current page?
From: "David Chu" <davidchu@aol.net>
===
Given that I am in an arbitrary page in my webapp, I have a header at the
top of each page that is a toggle button for some user state.  If the user
clicks the button, I want to reload the current page, with the user state
changed.  This is tricky because the request.getHeader("referer") is
sometimes not the most recent path of the Action just performed (in the case
of Actions forwarding to other Actions).

I think one way to accomplish this is write the current requested Action's
path to a session variable, for example, "/ViewShoppingCart.do," and, if the
next action is the click of the toggle button, forward to this path again
after doing what I need to (i.e. changing user state).

The problem is I do not know how to find a reference to any given Action's
path which are defined in the struts-config.xml.  How could I access this,
or how else could I accomplish this?

Thanks for the help!

--
-david

------------------------------
David C. Chu
America Online
Network Tools Intern
------------------------------



--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
2) Struts Newsgroup (@Basebeans.com) Session/Application level items disappearing when validate returns errors to page
| +1 vote
Subject: Session/Application level items disappearing when validate returns errors to page From:...
struts-user@jakarta.apache.org
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Subject: Session/Application level items disappearing when validate returns errors to page
From: "BillB" <bill.blackmon@verizon.net>
===
Hi,
I have the following declared at the top of a jsp page:
<%
// THIS SECTION IS NEVER 'SEEN' WHEN PAGE IS RETURNED WITH ERRORS......
Iterator disciplineListIt = (Iterator)
session.getAttribute("DISCIPLINE_LIST");
Iterator AGPAMemberListIt = (Iterator)
session.getAttribute("AGPA_MEMBER_LIST");
Iterator locationListIt = (Iterator) session.getAttribute("LOCATION_LIST");
Iterator membershipCategoryIt = (Iterator)
session.getAttribute("MEMBERSHIP_CATEGORY_LIST");
%>

These iterators populate different groups of checkboxes and contain bean
which contain a description and ID fields from the database.

I am using the following to fill a group of checkboxes (I know I should be
using some type of  Struts Tag but I haven't gotten that far yet - any
working, complete examples that would duplicate the following would be
greatly appreciated!).

<%
while(disciplineListIt.hasNext()) {
db = (DisciplineBean) disciplineListIt.next();
description = db.getDiscipline();
id = db.getDisciplineID();
sid = String.valueOf(id);
%>
<td align="left" width=50%>
<input type="checkbox" name="selDisciplineList" value="<%= sid %>" > <%=
description %>
</td>
<%

The output of the above and the returned selDisciplineList are exactly what
I want. However, if there
are errors when the Action forms validate method is called, all of the
checkbox groups that are created
by the above Iterators are no longer visible. I've tried making copies of
the iterators into Action form items
w/set and get methods and its the same output.

Is this a totally invalid approach using Struts or is there a much more
obvious way that I'm too blind to see
to do what I'm trying to accomplish?

Thanks,
Bill



--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
3) Struts Newsgroup (@Basebeans.com) How do I use the <html:checkbox> tag to replace of the past JSP code?
| +1 vote
Subject: How do I use the <html:checkbox> tag to replace of the past JSP code? From:...
struts-user@jakarta.apache.org
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Subject: How do I use the <html:checkbox> tag to replace of the past JSP code?
From: "news.basebeans.com" <judging.huang@intech.com.tw>
===
Hi,

    I used the following code to setup checkbox value and checked status
before using struts.
<%
if (arrSParameters != null) {
  for (Enumeration objEnu = arrSParameters.elements() ;
objEnu.hasMoreElements() ;) {
   objParameter = (PLSystemParameter)objEnu.nextElement();
%>
<input type="checkbox" name="parameterCode"
value="<%=objParameter.getParameterCode()%>"
<%=HTMLTools.getCheckedString(arrSPCodes,
objSParameter.getParameterCode())%>>
<%
  }
}
%>
    I used a for-loop to generate many checkboxes, and all of the
checkboxes' values are from java beans' property. Besides, I used a function
which utilize whether the specified java bean's property belong to a string
array to judge if the "checked" string was showed.

    I use the struts now. The following code is my experiment. I didn't know
how to setup the checkbox attribut to show "checked" string.
<logic:iterate id="objParameter" collection="<%= arrSParameters %>"
indexId="index">
  <html:checkbox name="objParameter" property="parameterCode" />
</logic:iterate>

    The result page didn't show the same as the result of the past code. The
struts result is follow code.
<input type="checkbox" name="parameterCode" value="on">
<input type="checkbox" name="parameterCode" value="on">
<input type="checkbox" name="parameterCode" value="on">
<input type="checkbox" name="parameterCode" value="on">
    The checkboxes's value is struts' default value "on" not the java beans'
property. I hope the result page shows the following code.
<input type="checkbox" name="parameterCode" value="WORK_START_HOUR">
<input type="checkbox" name="parameterCode" value="WORK_END_HOUR" checked>
<input type="checkbox" name="parameterCode" value="REST_START_HOUR">
<input type="checkbox" name="parameterCode" value="REST_END_HOUR" checked>
The checkboxes' values are appropriate for the java beans' property and the
"checked" string can be showed or not by condition.

    If the checkbox tag of the struts doesn't support this requirement or I
must extend the checkbox tag of the struts, please tell me, too.

Thank you very much

Judging Huang in Taiwan




--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
4) Struts Newsgroup (@Basebeans.com) How to re-populate multiple selected options in a dropdown combo box
| +1 vote
Subject: How to re-populate multiple selected options in a dropdown combo box From: "Hu Ji Rong"...
struts-user@jakarta.apache.org
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Subject: How to re-populate multiple selected options in a dropdown combo box
From: "Hu Ji Rong" <hujirong888@yahoo.com>
===
Hi,

I have the following code and String[ ] attribute with the same name in the
form bean, but got an error same bean with name stdAirspaceLimitList not
found.

       <html:select value="1000M" styleClass="txtBgManColor entryFont"
multiple="true" style="width: 157; height: 38"
property="stdAirspaceLimitList" size="2">
          <html:options property="stdAirspaceLimitList"/>
        </html:select>

What's wrong? What I want to do is select values from a non-multiple
dropdown combo box and put them into the multiple dropdown combox.

Thanks in advance.
JiRong



--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
5) Struts Newsgroup (@Basebeans.com) Re: How do I navigate from one subApp to another in Struts1.1?
| +1 vote
Subject: Re: How do I navigate from one subApp to another in Struts1.1? From: Serge Shikov...
struts-user@jakarta.apache.org
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Subject: Re: How do I navigate from one subApp to another in Struts1.1?
From: Serge Shikov <shikov@rinet.ru>
===
Craig R. McClanahan wrote:
> I'm afraid I don't understand your question. Don't you know which subapp
> you want to transfer control to?
Sure.

> If you want to remember where you came from, that is certainly something
> you would need to do for yourself -- perhaps by creating a session
> attribute that is either a string (if you don't need "gosub/return" type
> functionality) or a Stack (if you do).
What about request parameters and attributes? If current page before
call was

/sub-app1/action1.do?param1=value1¶m2=value2

shouldn't I also save query string? Return to /sub-app1/action1.do isn't
the same point as before call.

> Struts doesn't have anything built
> in to help you keep track of this.
Why not include this functionality by default?


--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>

spacer
Profile | Posts (3)
Home > People > Struts Newsgroup (@Basebeans.com)