Action Tag ignoreContextParams has no effect

2011-07-27 Thread anselmbauer
Hi,

I'm trying to include another action in a jsp wit the action tag (struts
2.0.8). 
All my action extend a main action with a lot of possible parameters. If I
include an action, all the setters for the included action are called
(although they are not set by the param tag). This is very annoying and
dangerous.
The ignoreContextParams flag has no effect.

Thanks in advance 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/Action-Tag-ignoreContextParams-has-no-effect-tp4639745p4639745.html
Sent from the Struts - User mailing list archive at Nabble.com.

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



Re: Session in Interceptors

2011-07-27 Thread Maurizio Cucchiara
Try something like
HttpSession session = ServletActionContext.getRequest().getSession();

On 27 July 2011 17:10, Eric Lentz  wrote:

> In an interceptor I have a need to store a value in the session. I can see
> a session map that I find in the invocation's object graph that is
> available in the interceptor, but storing back to the map has no effect.
> Is there a "Struts 2 way" to get/set the session within an interceptor or
> do I just do something like this?
>HttpServletRequest request = (HttpServletRequest)
> context.get(StrutsStatics.HTTP_REQUEST);
>HttpSession session = request.getSession(true);
>//set session as needed
>



-- 
Maurizio Cucchiara


Session in Interceptors

2011-07-27 Thread Eric Lentz
In an interceptor I have a need to store a value in the session. I can see 
a session map that I find in the invocation's object graph that is 
available in the interceptor, but storing back to the map has no effect. 
Is there a "Struts 2 way" to get/set the session within an interceptor or 
do I just do something like this?
HttpServletRequest request = (HttpServletRequest) 
context.get(StrutsStatics.HTTP_REQUEST);
HttpSession session = request.getSession(true);
//set session as needed


Re: SEVERE: Servlet.service() for servlet default threw exception, java.lang.IllegalStateException

2011-07-27 Thread Emi Lu

On 07/27/2011 01:55 AM, Ɓukasz Lenart wrote:

2011/7/26 Emi Lu:

Did you try to call check_search_oprProcessAction.action directly ?
And maybe it's better to JSON plugin instead of home made protocol ?


I was thinking about JSON result plus jQuery.


For people have similar questions, my solution for now based on ajax + 
jQuery is:

=
(1) In global tile template.jsp, added
   

   


(2) In script.js, defined:
==
function ajax_check(url)
{
   var xmlhttp;
   var str = $("form").serialize(); //http://api.jquery.com/serialize/
   var tmp_str = "";
   if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
   }
   else
   {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
   xmlhttp.onreadystatechange=function()
   {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
  {
 document.getElementById("ajax_error_div").innerHTML = 
xmlhttp.responseText;

  }
   }
   xmlhttp.open("POST", url, false);

xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); 


   xmlhttp.send(str);
   var str = document.getElementById("ajax_error_div").innerHTML;
   if(str == null || str.trim() == "")
   {
  return true;
   }
   return false;
}


(3) main_display.jsp
===


(4) struts.xml
=

  browse_main_page
  browse_main_page
  
/WEB-INF/pages/errorinfo/ajax_error_check.jsp
 
   


(5) ajax_error_check.jsp
==
<%@ taglib prefix="s" uri="/struts-tags"   %>
   
  
 style="width: 700px; border:thin solid black; 
background-color:#C5D1C0; padding-left: 10px; margin-bottom: 5px; "

   align="left">
   
  
  
  
   
  
  
   


   
 
  

 
 
 
 
 
  
  
   


Thank you for all inputs!

Emi

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