Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-16 Thread Burton Rhodes
Yes. I believe this is the case. Let me see if I can track down an example
that breaks. Right now I just have reports of this happening but I haven’t
been able to reproduce on my end yet.

Also, How would I include everything except the email body field with the
s:url tag?

Thanks,
Burton


On Monday, April 16, 2018, Yasser Zamani  wrote:

>
>
> On 4/15/2018 11:39 PM, Burton Rhodes wrote:
> > I have been getting "Bad Request" or "URL too long" errors on occasion
> for
> > an email form that uses the execute and wait interceptor.  I am using the
> >  to resubmit the form per the documentation.
> >
> > "/>
> >
> > However, the original form submits via POST and the meta tag uses GET
> which
> > I believe is the source of the issue.  I've tried the code below thinking
> > that I could omit all the parameters except the token, but this doesn't
> > seem to do the trick.  Struts wants the entire form (again) - without all
> > the parameters the validate methods fail for the action class.
> >
> > 
> > 
> > "/>
> >
> > Any ideas on how to implement execute and wait correctly without
> submitting
> > the entire form via GET parameters each time a refresh that happens?
>
> Could you try including all except the email body field? I guess this
> issue happens because the email body usually is too long to being
> included inside url query string. To confirm, could you increase refresh
> timeout to have time to right-click on your browser page then click view
> source? I'm interested what is generated by  content="3;url="/> there when there is a
> long email body posted!
>
> Thanks in advance!
>


Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-16 Thread Yasser Zamani


On 4/15/2018 11:39 PM, Burton Rhodes wrote:
> I have been getting "Bad Request" or "URL too long" errors on occasion for
> an email form that uses the execute and wait interceptor.  I am using the
>  to resubmit the form per the documentation.
> 
> "/>
> 
> However, the original form submits via POST and the meta tag uses GET which
> I believe is the source of the issue.  I've tried the code below thinking
> that I could omit all the parameters except the token, but this doesn't
> seem to do the trick.  Struts wants the entire form (again) - without all
> the parameters the validate methods fail for the action class.
> 
> 
> 
> "/>
> 
> Any ideas on how to implement execute and wait correctly without submitting
> the entire form via GET parameters each time a refresh that happens?

Could you try including all except the email body field? I guess this
issue happens because the email body usually is too long to being
included inside url query string. To confirm, could you increase refresh
timeout to have time to right-click on your browser page then click view
source? I'm interested what is generated by "/> there when there is a
long email body posted!

Thanks in advance!


Re: Struts2 login action class seems to be reused

2018-04-16 Thread Prasanth Pasala
Finally we redeployed the code with an added check to make sure the instance 
variables populated by struts match the request parameters. With in few hours 
of deployments we got emails indicating that
the values populated into the instance variables don't match those in request 
parameters. Below you can see the difference between the instance variable and 
the values in the request object.  The code
is also updated to store the hash code of Login action for each login, so that 
we can see if the object is reused. Surprisingly the hash code doesn't match 
with any of the hash codes stored for
successful logins. When the emails are triggered there is only a GET request 
for the Login action (which should display the login page, on the user enters 
the username & password it is submitted via
POST). So I am wondering where did these values come from into the instance 
variables?

-
Struts data doesn't match that in request object.
Struts Data:
    Username: jsmith
    Action: Login
Request Data:
    Username: null
    Action: null

Object Hash: 1573857416
-

Thanks,
Prasanth

On 03/16/2018 02:30 PM, Prasanth Pasala wrote:
> There is only one reference to Util.authenticate in the project and that is 
> in LoginAction.
>
> On 03/16/2018 02:13 PM, Yasser Zamani wrote:
>> And you confirm that those log record insertions are only possible via 
>> LoginAction.execute method? Right? Or util.authenticate are called elsewhere 
>> also?
>> On Mar 16, 2018, at 9:45PM, Prasanth Pasala 
>> > wrote:
>>
>> We have a pretty standard struts.xml just declaration of action and the 
>> class along with the results (tiles results). Nothing other than that.
>>
>> On 03/16/2018 11:55 AM, Yasser Zamani wrote:
>>
>>  On 3/16/2018 1:49 AM, Prasanth Pasala wrote:
>>  We do have login time, using that and the IP to correlate that with the 
>> access logs. Not all login entries have corresponding POST entries in access 
>> log, so those would be our problems occurrences.
>>  They actual correspond to a GET entry from a user.
>>
>>  IP of the GET request of User1 matches with the login record in the 
>> database (login would be for User2 id and IP from User1 GET). So it looks as 
>> if the same user logged in from two different IPs
>>  around the same time, which shouldn't be the case.
>>  I'm almost sure Struts always asks object factory to create the action
>>  on each request. This is belong to object factory if create a new one
>>  object of that action, or no, reuse a previous one object of an action.
>>  So have you set any specific object factory via struts.xml?
>>
>> 
>>
>>  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>  For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>



Re: Simple example of Struts plugin, extending TextField

2018-04-16 Thread Yasser Zamani


On 4/16/2018 9:10 AM, mli...@x76.eu wrote:
> Hi,
> I'm looking for a simple example on how to extend the textfield tag to
> only allow for certain input and display the value in a certain form
> when the field is initially displayed.
> 
> So the plugin handles the input validation via a specified attribute,
> and the output formatting according to another attribute.
> E.g.
> 
>    output="%(name)"  />
> 
> If you have or know where to find such and example, please let me know.

It seems you don't need to extend Struts textfiled as Struts already
supports both validations and formats. Just search "Struts regex
validation" and "Struts textfield format" :)

Regards.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Re: Triple select tag

2018-04-16 Thread Yasser Zamani


On 4/15/2018 12:01 AM, albert kao wrote:
> My requirement is triple select tag component implemented with Struts 2
> only, without any JS function.
> I am still learning how s:doubleselect tag works.
> I downloaded the source code from
> https://www.mkyong.com/struts2/struts-2-sdoubleselect-example/, compiled
> and run it successfully.
> This is still work in progress, so I am still working on an example of 3
> tag-components wired together.
> Please suggest any websites, blogs, examples or implementation tips.

Unfortunately, it seems Struts doesn't have any further component for
more than two selects (3, 4, 5, ... n dependent selects). However, you
can use java-script as advised (Strut's doubleselect also generates
java-script for client). Or more harder but nicer and cleaner, you can
review current Strut's doubleselect implementation and see if you can
improve it to accept N sequentially dependent selects! Then you can try
a share/merge into Struts :)

Regards.