Re: urls and iterations

2010-10-06 Thread Wataru Kou
Hi , Piotrek.

It was an insufficient explanation.
s:a tag use Rendering template /template/simple/a.ftl

bad, At each iterator reading template.
It is understood that the following programs work hard from the debug log.
ex : XWorkConverter  , FreemarkerTemplateEngine , UIBean

Therefore, s:a was not used because of the repetition,
 and it proposed the idea of which it displayed the character string.

A part of correction was added because it had seemed to be confused with the
environment variable.

   JSP

table border=1 class=threads 
 s:iterator value=tableValues 
   s:url var=show_url action=showThread  
s:param name=threadId value=%{id} /
/s:url
  tr
   tds:property value=id //td
   tda href='s:property value=%{show_url}  /'show/a/td
  /tr
 /s:iterator
/table

Thank you very well ..receiving stimulation...

It apologizes while studying English because of poor English.

Thanks
Kou


Re: urls and iterations

2010-10-05 Thread Wataru Kou
hi Piotrek

s:a is expanding ftl.
for example. link use String ?
It quickens a little.

   s:url var=show_url action=showThread escapeAmp=false 
s:param name=threadId value=%{id} /
/s:url
table border=1 class=threads 
 s:iterator value=tableValues 
  tr
   tds:property value=id //td
   tda href='s:property value=%{show_url} /?threadId=s:property
value=%{id} /' show/a/td
  /tr
 /s:iterator


if you're able to use JavaScript .
post id.
JavaScript function form submit.
ex : a onclick=onclickAction(%{id}) 

Thanks.
kou


Re: GET method action current value encoding

2010-07-04 Thread Wataru Kou
Dear Struts users.

It reports because it investigated a little more.
When StrutsPrepareAndExecuteFilter is used, the value passed with POST in
GET at the end of the passed value ,  is handed over by switching off the
district.

Isn't does not it investigate with RFC
when the same value is handed over with POST after the value is passed with
GET,
it nor correct operation that only the value of POST is handed over?

Moreover, the operation of the METHOD type was investigated with processing
in ValueStack.
When GET is processed, it is stored with ISO-8859-1.
When POST is processed, it is stored with UTF-8.

Therefore, when the value is acquired with GET, it is necessary to convert
it into UTF-8 from ISO-8859-1.
However, ISO-8859-1 in POST afterwards + It becomes UTF-8. The sufficient
result cannot be obtained.

It devised, and I assumed to the value handed over I evaded this problem.

Thank you.


2010年7月3日18:23 kou kou...@gmail.com:

 I've create GET method action Page with apache struts 2.1.8.1.
 I'm making a page in encoding UTF-8.

 struts action is setter value.
 POST method 's setter value is encoding UTF-8.
 but
 GET method 's value is encoding ISO-8859-1.

 This trouble resolved this Action setter.
 but When GET was performed and went on POST.
 The value is Incomplete.


 Fundamentally, would there be a way to correct a change in a character
 string besides this way?


 web.xml:
 filter-class
 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
 /filter-class

 java :
  action:
 public class SampleAction extends ActionSupport{
  public String execute(){return SUCCESS;}
  public void setData(String data){
  if(ServletActionContext.getRequest().getMethod().equals(GET)){
   try {
this._data = StringUtils.encoding(data);
   } catch (UnsupportedEncodingException e) {
   }
  }else{
   this._data = data;
  }
  }
  public String getData(){return _data;}
 }

  class:
 public class StringUtils {
  static public String encoding(String str) throws
 UnsupportedEncodingException {
  return new
 String(str.getBytes(ServletActionContext.getResponse().getCharacterEncoding()),ServletActionContext.getRequest().getCharacterEncoding());
  }
 }

 jsp Page:

 %@ page language=java contentType=text/html; charset=UTF-8
 pageEncoding=UTF-8%
 !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
 http://www.w3.org/TR/html4/loose.dtd;
 html
  body
 GET form method=GET 
  input name=data value=日本語/
  input type=submit /
 /form
 POST form method=POST 
  input name=data value=日本語/
  input type=submit /
 /formbr /
 s:property value=data/
  /body
 /html



 thank you.

 --
 kou kou...@gmail.com