> > I tested the code -- not that I needed to do so, but still. > > I'm sure you didn't need to test it "Oh almighty coding God."
Maybe I deserved that one. :) > > Here's an index.jsp that I've ran in Tomcat 5.x: > > > > > > <html> > > <head> > > <script> > > function swapAction( formName, action) { > > formAction = document.getElementById( formName ).action; > > newAction = '<html:rewrite page="/'+action+'.do"/>'; > > document.getElementById( formName ).action = newAction; > > } > > </script> > > <body> > > </body> > > </html> > > Are you saying that's how the resulting HTML looked? Yup. It's the same as the JSP. :-) > If so then you don't have a clue what the javascript was attempting to do because > that's not what the resulting HTML will look like if you are correctly > using the Struts html tag. Yeah, *if* you are using the Struts html tag correctly. However, this code does not use it correctly. :) > Sorry for sounding harsh but I've been > nothing but patient and instead all you've said, as of late, is stuff > like "That no one sees it is blowing my mind" or "This is ludicrous" Yeah, that stuff was not really needed. I sometimes put too much pepper in my e-mails. > yet you haven't explained what part you are seeing as "ludicrous." I thought I did, but I guess it seemed too uppity to believe. > On > top of that I've clearly showed what the html:rewrite tag will display > as HTML and showed how I could swap out using the html:rewrite tag if I > wanted (but would lose the nice URL encoding and sessionid stuff). You tried to "swap out" within Javascript Execution. That would happen on the client, and will not work! You can render your URL's on the server-side within a javascript block. For instance: //javascript var newAction = "<html:rewrite path="..."/>"; Then you end up with something like: var newAction = "/myContext/newAction.do;jsessionid=1234"; // maybe you won't have jsessionid > > I really hope that I don't need to go further with this. In the words > > of Mike Tyson, "This is ludicrous!" > > Your initial comment in this thread was: > > "It looks like JavaScript is being used to generate an <html:rewrite/>." > > and as Michael pointed out JavasScript isn't 'generating' anything and > as I've mentioned a bunch of times now all that the html:rewrite does is > write to the page encoding the URL and appending jsessionid if necessary. If we may take a more civil tone, do you still feel this way? Why don't you just try to actually use this function: function swapAction( formName, action) { formAction = document.getElementById( formName ).action; newAction = '<html:rewrite page="/'+action+'.do"/>'; document.getElementById( formName ).action = newAction; } And then post your results. > And I'm sure Kris jumped in the thread late or else he would have seen > my post about "I knew there was a reason I used html:rewrite verses > using the ${pageContext.request.contextPath}" stuff. (Which I mentioned > that later was a wrong approach). > > David, Kris is actually clarifing EXACTLY what we are talking about > when he mentions: > > "Tags like <html:rewrite> and <c:url> are great for generating > URLs to be used by JavaScript code that needs to interact with web apps. > One of the reasons they're so useful is that they have built-in support > for URL rewriting (encoding of session info)." You are assuming that I don't know what I'm talking about. By assuming, you have erred. > <snip> > Nobody in this industry knows it all. How could you possibly prove such a statement? Have a little faith. :) I'm not attacking you. - Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]