Re: Struts2 Checkboxlist

2019-02-01 Thread Arjuna Bandara
Hi,

As I understand, you need to modify previous Array before saving.

Have you tried Session variable ?

Regards

Arjuna

On Sat, 2 Feb 2019 3:18 am Prasanth,  wrote:

> Hi,
>
> I am using a checkboxlist on a jsp page which corresponds to a ArrayList
> in the form class, which is used to store form data from a multi page
> wizard. I am using scope interceptor to store the form
> class in session so that the data persists as the user navigates the
> wizard. When the user selects some check boxes it is correctly populated in
> the form class but if the user navigates back in the
> wizard and unchecks the check box (non of the check boxes selected) struts
> doesn't set the ArrayList to empty. It will still contain the old
> selection. What is the best way to solve this issue?
>
> My Options:
> 1. Should I use Preparable and set this ArrayList to empty? Since this is
> a wizard (multiple pages submitting to the same action) have to make sure
> it is done only when submitting the page that have
> these checkboxes.
> 2. Create two separate ArrayLists, one to get values from Struts and
> another to save the original selection and clear the first array list. Down
> side is I need to populate the list linked to the form
> when user navigates back to that page.
>
> Neither of them seem elegant. Is there a way to make struts set the
> ArrayList to empty when user doesn't select any check box?
>
> Using Struts 2.3.35
>
> Thanks,
> Prasanth
>


Re: A book of Struts

2018-10-17 Thread Arjuna Bandara
I mentioned jQuery since dojo plugin was depreciated. ✌

On Wed, 17 Oct 2018 9:38 pm Dave Newton,  wrote:

> On Wed, Oct 17, 2018 at 11:57 AM Arjuna Bandara 
> wrote:
>
> > - ajax with jQuery
> >
>
> I'd be a little cautious going down that rabbit hole as I learned in my
> previous S2 book.
>
> I think covering the basics of Ajax from the S2 side is good; I don't know
> how far down a jQuery-specific path I'd go.
>
> Although it might be worth covering the S2 jQuery plugin--I'm not sure; I'd
> have to think about that.
>


Re: A book of Struts

2018-10-17 Thread Arjuna Bandara
Hi,
++ For the commitment.
I would like to suggest few things as a beginner to the framework.

- dependency injection and spring integration
- authorization ( category or individual permission techniques for action
URLs) and spring security integration
- ajax with jQuery
- testing

Good luck 

On Wed, 17 Oct 2018 1:08 pm Lukasz Lenart,  wrote:

> Hi everyone,
>
> I would like to (finally ;-) write a book about the latest version of
> the Apache Struts, probably targeting Struts 2.6. I wonder what kind
> of book this should be:
> - an introduction from zero to a full blown app
> - a 101 good practices/examples
> - any other idea
>
> I hope you will give me some positive feedback to start working on this
> task :)
>
>
> Kind regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Struts 2.5 S:Select tag with Multiple True

2018-07-14 Thread Arjuna Bandara
Hi, kiran,

Have you tried with "value" property?



On Sat, Jul 14, 2018, 4:31 PM Kiran Kongala 
wrote:

> Hi Guys,
>
> We are using Struts 2.5.13 in our Enterprise Java Application and one of
> the jsp page has many Struts Select tags with multiple=true(s:select
> multiple=true) .
>
> I know that for selecting/deselecting multiple items in the list, we have
> to hold the Ctrl Key.
>
> But for the Users who are using our application, they have an issue.
>
> Suppose the User selected 5 items out of 20 in a multi select drop down by
> holding Ctrl Key and saved the page in the Add flow.
>
> In the Edit flow, the User wants to select 6th item in the existing multi
> select drop down and if the user forgets to hold the Ctrl key while
> selecting the 6th item, then all the other 5 items are deselected and only
> the 6th item is selected.
>
> Without even realizing that they deselected the other items in the list
> they save the page. By mistake they don't want that to happen.
>
> So they asked is there a way to work with the multi select by
> selecting/desecting multiple items in the list without holding the Ctrl Key
> or to stop this happening with the Select tag.
>
> So we added the below jquery script so that they can select/deselect
> without holding the Ctrl Key.
>
> jQuery('option').mousedown(function(e) {
> e.preventDefault();
> var selector = this.parentElement.id;
> jQuery(this).prop('selected', !jQuery(this).prop('selected'));
> jQuery('#' + selector).trigger('change');
> return false;
> });
>
> But this script only works in Chrome and may be FF but it doesn't work in
> IE.
>
> Because most of our Users uses the IE as the default browser and most of
> the application is tested on IE only, Is there any work around with this
> problem or is there any property in the S:SELECT which will solve this
> issue?
>
> Please help.
>
> Thanks
>


Re: Struts 2

2018-06-22 Thread Arjuna Bandara
Hi,

If you using dojo, you need to include dojo tag headers.

Also keep in mind that dojo was depreciated from struts 2. So they advise
to use jQuery.

When you sending post request, its url should end with ".json" suffix.

Regards
Arjuna



On Fri, Jun 22, 2018, 9:53 PM Deborah White 
wrote:

> It appears we are using dojo plugin.
>
> I need to upload an excel file and then be able to hit the add button that
> sends to my action that imports the data into the database.  I can send
> additional code and some screenshots if that would help.  Is it better to
> take it outside of this email thread?
>
> -Original Message-
> From: Arjuna Bandara [mailto:arjunab...@gmail.com]
> Sent: Thursday, June 21, 2018 6:28 PM
> To: Struts Users Mailing List 
> Subject: Re: Struts 2
>
> Hi,
>
> What's your expected output. And the falt?
>
> Do you use dojo plugin?
>
>
>
> On Fri, Jun 22, 2018, 3:25 AM Deborah White 
> wrote:
>
> > Hello, I'm hoping someone with more experience can help me with this.
> > When I do the file upload, it uploads the file and returns to the page
> > (but it looks like it breaks out of the view it was in) but then the
> > Add button does not work.  I believe I need to be able to post data to
> > my action class that is handling the file upload?  Please see my jsp
> code:
> >
> > <%@taglib uri="/struts-tags" prefix="s" %>
> >
> >
> > 
> >
> > function addBulkSellerAgent() {
> >var registrationId = '<s:property value="registrationId"/>';
> > var sellerId = '<s:property value="sellerId"/>';
> > var fileFileName = '<s:property value="fileFileName"/>';
> > var fromPage = 'sellerAgent';
> > var postData = "registrationId="+registrationId+
> >   "&sellerAgentData.sellerId=" +
> sellerId+
> >   "&fromPage=" + fromPage +
> >   "&fileFileName=" + fileFileName;
> > processRegistrationDetails('<s:url
> > value="addBulkSellerAgents.action" encode="true"/>', postData);
> > return false;
> > }
> > 
> >
> > Select File to Upload
> >  > enctype="multipart/form-data">  > name="file">  
> >
> >  > ENCTYPE="multipart/form-data" action="" method="post">
> >
> >   
> >
> >  
> >
> >  
> >   > id="clientSideError">
> >
> >   
> >  Add Seller Agents
> >  
> >
> > 
> >
> >  
> >   > width="642" style="margin:5px">
> >
> >   
> >   > class="button" type="button" value="Add" name="button_save"
> > onclick="return addBulkSellerAgent();" />
> >  <%-- > class="button" type="button" value="Reset" name="button_reset1"
> > onclick="return doSellerAgentFormClear();"/>--%>
> >   > class="button" type="button" value="Cancel" name="button_exit"
> > onclick="displayRegistrationDetails(' value="registrationView.action"
> > encode="true"> > value="%{registrationId}"/> > value="%{fromPage}"/>');" />
> >  
> >   > class="statusMessage">
> >   
> >
> >  
> >  
> >   
> >
> > 
> >
> > CONFIDENTIALITY NOTICE: This communication with its contents may
> > contain confidential and/or legally privileged information. It is
> > solely for the use of the intended recipient(s). Unauthorized
> > interception, review, use or disclosure is prohibited and may violate
> > applicable laws including the Electronic Communications Privacy Act.
> > If you are not the intended recipient, please contact the sender and
> > destroy all copies of the communication.
> >
>
> CONFIDENTIALITY NOTICE: This communication with its contents may contain
> confidential and/or legally privileged information. It is solely for the
> use of the intended recipient(s). Unauthorized interception, review, use or
> disclosure is prohibited and may violate applicable laws including the
> Electronic Communications Privacy Act. If you are not the intended
> recipient, please contact the sender and destroy all copies of the
> communication.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>


Re: Struts 2

2018-06-21 Thread Arjuna Bandara
Hi,

What's your expected output. And the falt?

Do you use dojo plugin?



On Fri, Jun 22, 2018, 3:25 AM Deborah White 
wrote:

> Hello, I'm hoping someone with more experience can help me with this.
> When I do the file upload, it uploads the file and returns to the page (but
> it looks like it breaks out of the view it was in) but then the Add button
> does not work.  I believe I need to be able to post data to my action class
> that is handling the file upload?  Please see my jsp code:
>
> <%@taglib uri="/struts-tags" prefix="s" %>
>
>
> 
>
> function addBulkSellerAgent() {
>var registrationId = '';
> var sellerId = '';
> var fileFileName = '';
> var fromPage = 'sellerAgent';
> var postData = "registrationId="+registrationId+
>   "&sellerAgentData.sellerId=" + sellerId+
>   "&fromPage=" + fromPage +
>   "&fileFileName=" + fileFileName;
> processRegistrationDetails(' value="addBulkSellerAgents.action" encode="true"/>', postData);
> return false;
> }
> 
>
> Select File to Upload
> 
> 
> 
> 
>
>  ENCTYPE="multipart/form-data" action="" method="post">
>
>   
>
>  
>
>  
>   id="clientSideError">
>
>   
>  Add Seller Agents
>  
>
> 
>
>  
>   width="642" style="margin:5px">
>
>   
>   class="button" type="button" value="Add" name="button_save" onclick="return
> addBulkSellerAgent();" />
>  <%-- class="button" type="button" value="Reset" name="button_reset1"
> onclick="return doSellerAgentFormClear();"/>--%>
>   class="button" type="button" value="Cancel" name="button_exit"
> onclick="displayRegistrationDetails(' encode="true"> value="%{registrationId}"/> value="%{fromPage}"/>');" />
>  
>   class="statusMessage">
>   
>
>  
>  
>   
>
> 
>
> CONFIDENTIALITY NOTICE: This communication with its contents may contain
> confidential and/or legally privileged information. It is solely for the
> use of the intended recipient(s). Unauthorized interception, review, use or
> disclosure is prohibited and may violate applicable laws including the
> Electronic Communications Privacy Act. If you are not the intended
> recipient, please contact the sender and destroy all copies of the
> communication.
>


Re: s:fielderror not working in Java 8, WebSphere

2018-06-14 Thread Arjuna Bandara
I have faced similar issue. problem is on Java 8.

On Thu, Jun 14, 2018, 8:12 PM Doug Breaux  wrote:

>
>
> On 2018/05/22 18:24:34, bre...@us.ibm.com  wrote:
> > Struts 2.5.14.1, WebSphere 8.5.5.13, IBM Java 8 (level 1.8.0_161) on AIX.
> >
> > We have a JSP with a plain  element that works without
> issue when we switch WebSphere back to Java 7, but in Java 8 produces the
> following error:
> >
> > 2018-05-22 12:43:24,384 ERROR [freemarker.runtime]: error - Error
> executing FreeMarker template
> > FreeMarker template error:
> > Java method "AbstractCollection.size()" threw an exception when invoked
> on LinkedHashMap$LinkedKeySet object "[]"; see cause exception in the Java
> stack trace.
>
> FYI, after pursuing as IBM Java issue, it now appears to be an issue with
> a 3rd-party agent installed to the JVM, and am pursuing with them.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Ajax post url

2018-06-13 Thread Arjuna Bandara
I want to send a post request with few attributes as a subsidiary to form 
submission. 
Js

https://pastebin.com/embed_iframe/UEvTiBFz; 
style="border:none;width:100%">

Action class method

https://pastebin.com/embed_iframe/CPPWRTSr; 
style="border:none;width:100%">


Struts XML

https://pastebin.com/embed_iframe/HG71mjbr; 
style="border:none;width:100%">


But struts url does not work as expected. Guys please help me to sort this out, 
since I am new to struts 2.

Regards

Arjuna