Thank you for your valuable reply.

Well, in that case my problem is probably unsolvable. Main problem is, that
i don't know how many embedded urls there is going to be in larger text
blocks stored in DB. I could count them, but only on runtime. So, only
solution would be automatically generate s:url tags. I'll have to find out
another solution. Somebody posted me link to  http://tuckey.org/urlrewrite/
http://tuckey.org/urlrewrite/ , so I'll check it tomorrow. Thank you.



Laurie Harper wrote:
> 
> If the URLs you are substituting in are external to the web app, they 
> don't need to be 's2-friendly'; an external site doesn't care about your 
> Struts app's session ID, etc. If the URLs are (or may be) internal to 
> the application, however, you do need to take care of that. In that 
> case, use s:url tags directly, generating the attribute values (as 
> opposed to trying to generate the entire s:url tag).
> 
> You haven't how you're exposing the URLs to the page (are they embeded 
> in larger text blocks? Are they stand-alone text fields in the DB?) but 
> essentially what you'd want is to be able to write something like this 
> in your JSP:
> 
> ... <s:url value="%{myurl}"/> ...
> 
> where 'myurl' is either a property containing the URL with the PHP tags 
> already stripped, or a method that looks up the URL and does the PHP tag 
> stripping.
> 
> The key point is, you can't build something that generates the s:url 
> tags themselves, you you can build something that generates the input 
> data you need to feed to the s:url tags.
> 
> L.
> 
> esemba wrote:
>> Thank you for your reply.
>> So you think there is now way, how to parse urls out of the text stored
>> in
>> the db and make them s2-friendly (i mean jsessionid rewriting in case of
>> disabled cookies, etc.)?
>> 
>> 
>> 
>> esemba wrote:
>>> Hi,
>>> i'm migrating my old php website to Struts 2 and have problem with url
>>> management. In my db, i have urls tagged like this
>>> [url]http://url.com/[/url]. In php, i just do regexp replace of this
>>> custom
>>> url tags with proper html tags. I would need to do something like this
>>> in
>>> struts 2, but want to use <s:url>. Best solution would be like this: In
>>> jsp(ognl) replace every occurrence of [url]url string[/url] with 
>>> <s:url value= ">.
>> 
>> That wouldn't work, since JSP custom action tags are processed at page 
>> compilation time; by the time your substitution happened (during page 
>> rendering) it's too late to introduce s:url tags.
>> 
>> I this case, you probably don't need s:url tags anyway; just use vanilla 
>> HTML  ... 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--URL-management-tp19494989p19522098.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to