Hello you people,

maybe someone knows: 

why does the var $1 get evaluated in this code (or how do i address it alright so it 
would get evaluated, as it obviously seems to be out of scope!?):

(jsp-code)
<rx:regexp id="rx4">s/href="(?!http:)(.*?)"/<%= response.encodeURL("$1") 
%>"/gmi</rx:regexp>

(generated servlet code:
                do {
                // end
                // HTML // begin [file="/db_mbhw.jsp";from=(196,20);to=(196,44)]
                    out.write("s/href=\"(?!http:)(.*?)\"/");

                // end
                // begin [file="/db_mbhw.jsp";from=(196,47);to=(196,73)]
                    out.print( response.encodeURL("$1") );
                // end
                // HTML // begin [file="/db_mbhw.jsp";from=(196,75);to=(196,80)]
                    out.write("\"/gmi");

                // end
                // begin [file="/db_mbhw.jsp";from=(196,80);to=(196,92)]
                } while (_jspx_th_rx_regexp_3.doAfterBody() == 
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
)

and not in this one ?

(jsp-code)
<rx:regexp id="rx3">s/href="(?!http:)(.*)"/href="generic_import.jsp?url=<%= 
java.net.URLEncoder.encode("$1") %>"/gmi</rx:regexp>

(generated servlet code:
                do {
                // end
                // HTML // begin [file="/db_mbhw.jsp";from=(194,20);to=(194,71)]
                    
out.write("s/href=\"(?!http:)(.*)\"/href=\"genric_import.jsp?url=");

                // end
                // begin [file="/db_mbhw.jsp";from=(194,74);to=(194,108)]
                    out.print( java.net.URLEncoder.encode('$1') );
                // end
                // HTML // begin [file="/db_mbhw.jsp";from=(194,110);to=(194,115)]
                    out.write("\"/gmi");

                // end
                // begin [file="/db_mbhw.jsp";from=(194,115);to=(194,127)]
                } while (_jspx_th_rx_regexp_2.doAfterBody() == 
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
)

basically, what i need to do, is to parse an imported resource and take specific hrefs 
and modify them so they would hand over their values as a parameter to another jsp, 
which imports that given param (the original url).
You see the problem why i need encoding looks like this: 
href="generic_import.jsp?url_param=original_url?p1=value1&p2=value2" 

ps: maybe there is also a tag that would do the task, but for example <c:urlencode> is 
deprecated, <c:url> only seems to rewrite and i did not come across another similar 
solution !

thanx in advance for your kind help.

timo einsiedler-burger


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to