This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi , I have the following code on the submit of command button on the jsp page
I need to send all the parameters after rwservlet? as hidden parameters. These values do not come from any form field on the page. They are a part of the properties file on the disk. I would not like them to be displayed to the user when loading the next webpage or on the next web page.
Please let me know if there is any way to mark specific parameters in externalcontext.redirect() as hidden programatically
You mention the parameters are in a properties file on disk... then why not just populate a Properties from the start and put it in a session or application scope. Then use that object instead in the redirected page or whenever you need it.
Hi , I have the following code on the submit of command button on the jsp page ...
I don't think so. In Java 2.0, JSP view templates are no longer supported. It would have to be an xhtml View Definition Language Template.
I need to send all the parameters after rwservlet? as hidden parameters. These values do not come from any form field on the page.
If you don't have a form, then you are submitting an HTTP GET request. On an HTTP GET the parameters are part of the URL and by definition, not something that can be hidden.
The cleanest/simplest way to hide data is never to post it out to the client to begin with. In JSF, this is a normal part of the architecture. Just keep your data in (session-scope) backing beans.
On the other hand, it appears that you are attempting to forward a parameterized request to an external server, so session-scope data is not an option. And, in fact, it's the report server that forces the request parameters to be part of the URL.
If you can, reformulate your request to submit the parameters in a form. That well keep them off of the URL and thus invisible to the client. If you cannot, you are probably going to have to serve as a proxy. Instead of forwarding the request, your application code will probably have to submit the request internally, receive the generated report output, and pass that output back to the client. Since the output will probably NOT be in JSF format (and will most likely be something like a PDF), your actual Submit handler is probably better done as a Plain Old Servlet, not routed via JSF.
An IDE is no substitute for an Intelligent Developer.