JSP Section Index | Page 2
In our JSP form , we are accepting user name and passwords & we submit the form using POST method to a servlet. How safe is this? Is their any way someone can use a sniffer and get this password? What is the right way to accept usernames & passwords?
What I do is this: On the user's form I have two visible form inputs, username and password, and two hidden form inputs, sessionid and response. Initially I set sessionid to the request session id...more
How can I pass XML generated by JSP to Cocoon for further processing?
[
I am using tomcat 3.2.1 and cocoon 1.8.2. and I am using JSP's for dynamic generation of XML. How can i give this XML output to cocoon to apply XSLT (based on the requested client) and to give t...more
How can one specify use of an external compiler to compile JSP files?
About external compiler - like jikes or other - you have to make a wrapper class implementing org.apache.jasper.compiler.JavaCompiler that calls your compiler (with your own parameters), and spec...more
Inside a JSP, how to represent private methods and call them?
[I wrote a servlet, and I want to convert it to a JSP file.
Usually it is very simple - all of the code of the "doGet" method directly goes into the JSP.
But now I have a private metho...more
Can I access a method declared in a jsp page from another jsp page?
Yes you can access methods declared in one jsp page from another by including the other jsp page in the first by using the directive
<%@ include file="other.jsp" %>
Is there a freeware or shareware Web forum application written in Servlet or JSP?
Check out Jive.
From the site:
Jive is forum software that allows threaded discussions on websites. It features excellent performance, user-defined "skins" to completely change the look, feel, a...more
Where are the servlet source files for JSPs compiled in Tomcat?
[JSP is first translated into servlet than compiled. So where are those servlet .java or .class files for JSP examples in Tomcat?]
They are located in the work directory of the TOMCAT_HOME, unde...more
Is it possible to process JSP code written by a custom tag?
Is it possible to process JSP code written by a custom tag?
I have a custom tag that performs a xsl
transformation. This tag writes the output to the jsp page that's including the tag. My problem...more
How do I restrict an user from exceeding data of a particular length in a TEXTAREA like we do with a text box using the maxlength attribute?
The text area doesn't have an attribute like maxlength, so there are two ways to check this: a client side and a server side.
The first one (client side check) has to be written with a language li...more
How can I create a protected, "restricted" website? I.e., where someone can only access the site by e.g., entering a password.
Normally web servers have their own protection system already in place. If you are running Apache, for example, or anothe NCSA compliant web server, you can rely on the standard basic authenticati...more
I need to find out how to transform a xml document and save the results using JSP. The JSP will request the source documents of the xml and xsl from a form (ie file already exist on the server) and the JSP would save the results to a file on the server. I can achieve this though a GUI and applying the templates and saving the results to a file bit the same code doesn't work with the JSP. I am using the Java API for xml woth Xalan XSLT processor.
Transformer class will take source and write the results to StreamResult which take Writer object as a parameter on one of the constructors. So you can use the Transformer, create DOMSource from y...more
How can I get details regarding a browser (make, version, platform, etc.) from within a JSP page?
You can retrieve any HTTP header information (including User-Agent) through the request object. The following scriptlet should return browser information:
<%=request.getHeader("User-Agent...more
I am using a response.sendRedirect(response.encodeRedirectURL(page)) in a custom tag.
I am using a response.sendRedirect(response.encodeRedirectURL(page)) in a custom tag.
As far as I know this should cause the browser to redirect to the page specified.
However, instead of redirec...more
How can I use the the result of isValid() method of TagExtraInfo class in my application to validate the attributes of a custom jsp tag since my tag class and the class which extends TagExtraInfo are different classes?
The isValid() method of the TagExtraInfo class is called by the JSP engine before your custom tag is executed, i.e. before the doStartTag() method is called.
The current values of the attributes a...more
I have an html page which is used to submit data into a jsp page. This jsp page invokes a bean, which may take a lot of time to execute. I need to show an intermediate page which says "executing bean", while the bean is being executed. How can I do this?
In a recent project, I did the following:
* file entry.jsp contains a form. The form accepts user input and contains two hidden fields "nextURLDelay" (value 5) and "nextURL"...more