Re: [maybe OT] Detecting if a new window or tab was opened (server-side)

2011-03-17 Thread Maurizio Cucchiara
Why would you track a window open event?
I don't know what exactly your requirements are but I think it should be
quite simple to /intercept/block/change every mouse click event which is
not  the left click event through javascript.

Maurizio Cucchiara

Il giorno 16/mar/2011 22.26, Wes Wannemacher w...@wantii.com ha scritto:
Does anyone know of a good trick to detect whether a new window or tab
was opened by the user...

Here is the scenario, a user is looking at a view and he/she
right-clicks one of the links and chooses to open the link in a new
tab or window. The original view and the new tab or window will share
the session, but I'd like to know that there are two windows (or tabs)
interacting with the site.

I thought about trying to track the referrers as requests come in, but
I get stumped when I realize that a user can re-visit a page.

There are some javascript mechanisms, but by the time I can detect
from javascript that a window is new, the response is already being
rendered (committed).

Here is one link I found, but the code is poorly formatted making the
example difficult to follow -

https://sites.google.com/site/sarittechworld/track-client-windows

-Wes

--
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: [maybe OT] Detecting if a new window or tab was opened (server-side)

2011-03-17 Thread Brian Thompson
CTRL-click?
Shift-click?
Configure the browser to open all links in new tabs?  I'm pretty sure you
can do that in Firefox.

And please don't suggest blocking mouse events.  I like to use those
features, and I really hate it when sites try to hijack my browser that
way.  It's one of the more user-hostile things you can do.


On Thu, Mar 17, 2011 at 1:51 AM, Maurizio Cucchiara 
maurizio.cucchi...@gmail.com wrote:

 Why would you track a window open event?
 I don't know what exactly your requirements are but I think it should be
 quite simple to /intercept/block/change every mouse click event which is
 not  the left click event through javascript.

 Maurizio Cucchiara

 Il giorno 16/mar/2011 22.26, Wes Wannemacher w...@wantii.com ha
 scritto:
 Does anyone know of a good trick to detect whether a new window or tab
 was opened by the user...

 Here is the scenario, a user is looking at a view and he/she
 right-clicks one of the links and chooses to open the link in a new
 tab or window. The original view and the new tab or window will share
 the session, but I'd like to know that there are two windows (or tabs)
 interacting with the site.

 I thought about trying to track the referrers as requests come in, but
 I get stumped when I realize that a user can re-visit a page.

 There are some javascript mechanisms, but by the time I can detect
 from javascript that a window is new, the response is already being
 rendered (committed).

 Here is one link I found, but the code is poorly formatted making the
 example difficult to follow -

 https://sites.google.com/site/sarittechworld/track-client-windows

 -Wes

 --
 Wes Wannemacher

 Head Engineer, WanTii, Inc.
 Need Training? Struts, Spring, Maven, Tomcat...
 Ask me for a quote!

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



update a complex object through struts2

2011-03-17 Thread maven apache
Hi:

I meet some problem when I use struts as the mvc framework in my app,

They are the core  classes:

*Task{
  private int id;
  private String name;

  private ListTaskStep steps;
}

TaskStep{
  public int id;
  private String name;
  private Date startDate;
  private TaskStatus status;
  private ListOperator operators;
}

Operator{
  private int id;
  private String name;

}

Enum TaskStatus{
  start,doing,completed
}*

So,a task objec has relationship with so many other objects, now I have a
page to update(modify) a speified task:

I can read each attribute of the task and display it in the page,but I do
not know when user modify something(for example,modify the name of or
add/remove some operators of one its step.

At this time,how to transfer these information to the server side and update
it in the db?

BTW,I use the hiberante as the dao.


Redirect and pass as a parameter the original url from an Interceptor

2011-03-17 Thread Alfredo Manuel Osorio Martinez
I am implementing a Login interceptor which needs to redirect to an
action to first authenticate the user. The problem is that I want to
send as a parameter to that action the original url, the one that the
user was trying to get before the redirect to the login page.

 

How can I achieve that?

 

Thanks in advance,

 

Alfredo Osorio



Re: Redirect and pass as a parameter the original url from an Interceptor

2011-03-17 Thread Muneer Malik
can you not pass params within your interceptor?

interceptor-ref name=checkTabsStack
 param name=tabNameavailability/param
/interceptor-ref


Best,


On Thu, Mar 17, 2011 at 1:48 PM, Alfredo Manuel Osorio Martinez 
alfredo.oso...@afirme.com wrote:

 I am implementing a Login interceptor which needs to redirect to an
 action to first authenticate the user. The problem is that I want to
 send as a parameter to that action the original url, the one that the
 user was trying to get before the redirect to the login page.



 How can I achieve that?



 Thanks in advance,



 Alfredo Osorio




-- 
Confidentiality Notice
---


THIS INFORMATION IS INTENDED ONLY FOR THE USE OF THE ADDRESSEE AND MAY
CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM
DISCLOSURE UNDER APPLICABLE LAW.  IF YOU ARE NOT THE INTENDED RECIPIENT, OR
THE EMPLOYEE OR AGENT RESPONSIBLE FOR DELIVERING THIS MESSAGE TO THE
INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION,
DISTRIBUTION OR COPYING OF THE COMMUNICATION IS STRICTLY PROHIBITED.  IF YOU
HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY IMMEDIATELY AT
tutti...@gmail.com OR BY TELEPHONE AT 817-458-1764.


THANK YOU.


Re: Redirect and pass as a parameter the original url from an Interceptor

2011-03-17 Thread Okan Özeren
Hi,

I mean, you want to get a parameter as passed with original url by
query string. Am I right? You sould use this implementation:

// Get the action context from the invocation so we can access the
// HttpServletRequest and HttpServletResponse objects.
final ActionContext context = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest)
context.get(StrutsStatics.HTTP_REQUEST);
String param = request.getParameter(param);

Okan Özeren.

On Thu, Mar 17, 2011 at 8:48 PM, Alfredo Manuel Osorio Martinez
alfredo.oso...@afirme.com wrote:
 I am implementing a Login interceptor which needs to redirect to an
 action to first authenticate the user. The problem is that I want to
 send as a parameter to that action the original url, the one that the
 user was trying to get before the redirect to the login page.



 How can I achieve that?



 Thanks in advance,



 Alfredo Osorio



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



Re: Redirect and pass as a parameter the original url from an Interceptor

2011-03-17 Thread Muneer Malik
I guess not even pass as a query string,

he needs to pick up the URL from the request object:

request.getRequestURL()

Best,

On Thu, Mar 17, 2011 at 3:33 PM, Okan Özeren okanoze...@gmail.com wrote:

 Hi,

 I mean, you want to get a parameter as passed with original url by
 query string. Am I right? You sould use this implementation:

 // Get the action context from the invocation so we can access the
 // HttpServletRequest and HttpServletResponse objects.
 final ActionContext context = invocation.getInvocationContext();
 HttpServletRequest request = (HttpServletRequest)
 context.get(StrutsStatics.HTTP_REQUEST);
 String param = request.getParameter(param);

 Okan Özeren.

 On Thu, Mar 17, 2011 at 8:48 PM, Alfredo Manuel Osorio Martinez
 alfredo.oso...@afirme.com wrote:
  I am implementing a Login interceptor which needs to redirect to an
  action to first authenticate the user. The problem is that I want to
  send as a parameter to that action the original url, the one that the
  user was trying to get before the redirect to the login page.
 
 
 
  How can I achieve that?
 
 
 
  Thanks in advance,
 
 
 
  Alfredo Osorio
 
 

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




-- 
Confidentiality Notice
---


THIS INFORMATION IS INTENDED ONLY FOR THE USE OF THE ADDRESSEE AND MAY
CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM
DISCLOSURE UNDER APPLICABLE LAW.  IF YOU ARE NOT THE INTENDED RECIPIENT, OR
THE EMPLOYEE OR AGENT RESPONSIBLE FOR DELIVERING THIS MESSAGE TO THE
INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION,
DISTRIBUTION OR COPYING OF THE COMMUNICATION IS STRICTLY PROHIBITED.  IF YOU
HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY IMMEDIATELY AT
tutti...@gmail.com OR BY TELEPHONE AT 817-458-1764.


THANK YOU.


Re: Redirect and pass as a parameter the original url from an Interceptor

2011-03-17 Thread Roger Varley
On Thu, 2011-03-17 at 12:48 -0600, Alfredo Manuel Osorio Martinez wrote:
 I am implementing a Login interceptor which needs to redirect to an
 action to first authenticate the user. The problem is that I want to
 send as a parameter to that action the original url, the one that the
 user was trying to get before the redirect to the login page.

This is not a direct answer to your question, but I would suggest that
rather than re-inventing the wheel, you take a look at integrating
Spring Security, what you're looking for is implemented out of the box
with a bit of configuration.

Regards



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



RE: Redirect and pass as a parameter the original url from an Interceptor

2011-03-17 Thread Alfredo Manuel Osorio Martinez
Thanks all for your answers, I solved it by calling request.getRequestURL() and 
setting a request attribute with the original url. The redirect gets that 
attribute and includes it in the querystring. 

global-results
result name=registrarAgente type=redirect

/agente/RegistrarAgenteAction_input.action?urlOriginal=${#request.urlOriginal}
/result
/global-results

I will also check the Spring Security.

Alfredo Osorio

-Mensaje original-
De: Roger Varley [mailto:roger.var...@googlemail.com] 
Enviado el: Thursday, March 17, 2011 4:48 PM
Para: Struts Users Mailing List
Asunto: Re: Redirect and pass as a parameter the original url from an 
Interceptor

On Thu, 2011-03-17 at 12:48 -0600, Alfredo Manuel Osorio Martinez wrote:
 I am implementing a Login interceptor which needs to redirect to an
 action to first authenticate the user. The problem is that I want to
 send as a parameter to that action the original url, the one that the
 user was trying to get before the redirect to the login page.

This is not a direct answer to your question, but I would suggest that
rather than re-inventing the wheel, you take a look at integrating
Spring Security, what you're looking for is implemented out of the box
with a bit of configuration.

Regards



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