[ 
https://issues.apache.org/jira/browse/WW-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17156516#comment-17156516
 ] 

Lia_Eur commented on WW-5082:
-----------------------------

Lukasz, thank you very much for your answers. As I wrote, we have problems with 
the produced ids on the HTML pages. For example, on a generated HTML page with 
the updated struts the following form element is produced :

<form id="zuleitung" name="zuleitung" 
action="/name_of_our_application/zuleitung?id=3" method="post">

in comparison with the struts 2.1.6 where this element was : 

<form id="zuleitung_id_3" action="zuleitung?id=3" method="post">.

This difference occurs because of the changes in the classes I wrote in my 
previous message. The new entered code in ServletUrlRenderer.class causes the 
problem with the different action name. In UIBean.class there is a difference 
in method protected void populateComponentHtmlId(Form form) \{ ... } and as a 
result an other condition is satisfied now, this with the null ID. So in many 
pages no ID is produced for some elements where with struts 2.1.6 there was an 
ID for these elements.

UIBean.class
{code:java}
...} else if (null == (generatedId = escape(name != null ? findString(name) : 
null))) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Cannot determine id attribute for [#0], consider 
defining id, name or key attribute!",  this);
            }
            tryId = null;
}...
{code}
ServletUrlRenderer.class
{code:java}
if (action != null && action.indexOf("?") > 0) { 
 String queryString = action.substring(action.indexOf("?") + 1); 
 actionParams = urlHelper.parseQueryString(queryString, false); 
 action = action.substring(0, action.indexOf("?"));
}
{code}
This is only an example of the produced differences in our application. Is 
there any way to override these changes? I will post also on the suggested link 
you wrote in your previous message. Thanks!

 

 

 

 

> struts2 update from 2.1.6 to 2.3.37
> -----------------------------------
>
>                 Key: WW-5082
>                 URL: https://issues.apache.org/jira/browse/WW-5082
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.3.37
>         Environment: java 8
>            Reporter: Lia_Eur
>            Priority: Major
>             Fix For: 2.6
>
>
> We have upgraded our application from struts2 2.1.6 to *struts2 2.3.37* and 
> we face the following problem. Τhe generated HTML pages do not include ids 
> for some elements as they did before. That happens because in the new version 
> of struts2 there were made changes in the classes *UIBean.class* (methods 
> changed: escape() and populateComponentHtmlId() ) and 
> *ServletUrlRenderer.class* (method changed: renderFormUrl () ). As a result 
> these ids are not produced any more. We need the ids in our application 
> because the application must work also with shortcuts and this is possible 
> only if there are ids for the elements in order to be possible the selection 
> of an element through its id. Could you suggest us a possible solution for 
> this problem?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to