answersLogoWhite

0

Is it possible to include a doc file in a JSP page?

Updated: 8/18/2019
User Avatar

Wiki User

13y ago

Best Answer

Yes. You can embed spreadsheets, pdfs and word documents in a JSP Page

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is it possible to include a doc file in a JSP page?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is tag lib directive in jsp?

The taglib directive in JSP is used to declare a set of custom tags defined in tag libraries that are used in the JSP page. It must be placed at the top of the JSP page and specifies the location of the tag library descriptor (TLD) file and the prefix to use when referencing the custom tags within the page. This allows developers to use custom tags in their JSP pages to encapsulate reusable functionality.


How can i Write jsp page?

A JSP File Contents:A JSP file can contain the following:a. HTML contentsb. JavaScriptc. Java CodeCombining the features of the above 3 mentioned items; we get a powerful entity called the JSP. JSPs are used for the User Interface layer or the more colloquially called Front End layer of any J2EE application.JSP SkeletonBelow is how a Skeleton JSP File would look like. (The file has to be saved as .jsp)// Page Imports


What is the anatomy of a jsp page?

A JSP File Contents:A JSP file can contain the following:a. HTML contentsb. JavaScriptc. Java CodeCombining the features of the above 3 mentioned items; we get a powerful entity called the JSP. JSPs are used for the User Interface layer or the more colloquially called Front End layer of any J2EE application.JSP SkeletonBelow is how a Skeleton JSP File would look like. (The file has to be saved as .jsp)// Page Imports


What are the components of jsp?

A JSP File Contents:A JSP file can contain the following:a. HTML contentsb. JavaScriptc. Java CodeCombining the features of the above 3 mentioned items; we get a powerful entity called the JSP. JSPs are used for the User Interface layer or the more colloquially called Front End layer of any J2EE application.JSP SkeletonBelow is how a Skeleton JSP File would look like. (The file has to be saved as .jsp)// Page Imports


What is the purpose of page directive in JSP?

The Page Directive is one of the important components of any JSP Page. It can help us define page specific properties like Buffer size or location of an error page etc A JSP page, and any files included via the include directive, can contain one or more page directives but no duplicates. The JSP container will apply all the attributes to the page. The position of these page directives is irrelevant, but it is good practice to keep them together at the top of the page. (So that we can identify them easily)


How do you import jsp file in servlet?

I think the name of the jsp file is included in the web.xml of the servlet


How do you get the image file from the database with JSP?

You can retrieve an image file from a database in JSP by writing a servlet that fetches the image from the database and streams it to the JSP page. The servlet will set the content type to "image/jpeg" or the appropriate image format and write the image data to the response output stream. In the JSP page, you can then display the image by setting the source attribute of the img tag to the servlet URL.


Jsp file is text or xml based document?

A JSP file is a text based document with a .jsp extension. The file can contain HTML content, Java code and other text.


How can you compile the jsp file?

JSP file would be automatically compiled by an engine called Jasper in the servelt containter.


Can I prevent the creation of a session in a JSP page?

Yes you can. Use the below line in your JSP page to accomplish it. <%@ page session="false" %>


What are the Implicit object in JSP?

The implicit objects in a JSP page are:requestresponsepageContextsessionapplicationoutconfigpage


What is the difference between jsp forward and response sendRedirect?

The <jsp:forward ..> is actually a call to HttpServletRequest.forward(String url) which passes the request object within the server to either a servlet or to another JSP page. The new servlet or JSP page continues to process the same request and the browser is not aware of the fact that more than one servlet or page is involved. i.e., The client is not aware that the request is being forwarded somewhere else. The URL shown in the browser stays unchanged when you do this forward. The <jsp:forward> element forwards the request object containing the client request information from one JSP file to another file. The target file can be an HTML file, another JSP file, or a servlet, as long as it is in the same application context as the forwarding JSP file. The lines in the source JSP file after the <jsp:forward> element are not processed. The page invoked by the <jsp:forward> action has access to all the parameters in the original JSP page's request object. You can add new parameters to the request object to pass to the target page by using the <jsp:param name="..." value="..." />. Be careful when using <jsp:forward> with unbuffered output. If the JSP file has any data in the out object, using this forward action will cause an IllegalStateException to be thrown when the page is displayed. The response.sendRedirect() creates a new request object which doesn't carry any of old request information. The first request handler JSP page tells the browser to make a new request to the target servlet or JSP page. The URL shown in the browser therefore changes to the URL of the new page to which you redirect. A redirect is slower than a forward because the browser has to make a new request. Another difference is that request scope objects are no longer available after a redirect because it results in a new request. If you need to pass data to the page you redirect to, you have to use a query string and pass them as request parameters or save the data in the session or application scope objects Forward is faster than redirect but one disadvantage is that URL is not changed and also it works within the same web application. Also, when you choose to use forward, you need to think and confirm what must happen if the user reloads the page.