Hello, I'm looking to try and build a plugin that will scan through a bunch of pages and fix a load of links.
You can't access the links using the standard 'page.getBodyAsString()' so I used the renderer to output the body as HTML, and now I have access to the links and can manipulate them how I want to which is great.
What I'm stuck with is how I now save those edits back into the page?
Here's a bit of code to give some context...
String pageHTML = renderer.render(page.getContentEntityObject()); pageHTML = pageHTML.replaceAll("x", "y"); //Make changes to the page HTML
So I have this string, 'pageHTML' which I can manipulate to my hearts content, but can anyone help me with how to save this string as the new HTML of the page in question once I'm done making changes?
Thanks in advance
Matt
Community moderators have prevented the ability to post new answers.
You can use : <%=pageHTML%> to print out the whole contents on your current *.jsp page
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.