Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Kiran
styling jsp
3 Answer(s)      4 years and 5 months ago
Posted in : JSP-Servlet


Hi,

I need to style my jsp file, to have a header,footer and left margin and rest goes my body. And I'm going to include a different jsp for each of those(header,footer and left margin). I'm doing this for header and footer by calling like this

<%@ include file="header.jsp" %>
</div>

I dont know how to do it for left margin. please let me know.

Thanks,

Advertisement
View Answers

June 8, 2010 at 4:24 PM


Hi Friend,

Try the following code:

1)header.jsp:
<html>
<head>
<style>
div.figure {
float: center;
width: 100%;
height:28%;
}
div.figure p {
text-align: center;
font-style: italic;
font-size: smaller;
text-indent: 0;

}
</style>
</head>
<div class="figure">
<p><img src="header.jpg" width="100%"
height="80%" >
</div>
</html>

2)footer.jsp:

<html>
<head>
<style>
div.footer {
position:absolute;
float: center;
width: 98%;
height:15%;
border:solid;
bottom:0;


}
div.footer p {
text-align: center;
font-style: italic;
font-size: smaller;
text-indent: 0;

}
</style>
</head>

<div class="footer">
<p>Our site contains several useful examples and applications of Java, JSP, Hibernate, Struts, JSF, RMI, MySQL , Spring, EJB, Flex etc which will be helpful for you. Visit the following link:

<a href="http://www.roseindia.net">www.roseindia.net<a>;
</p>
</div>
</html>

3)left.jsp:

<html>
<head>
<style>
div.leftmargin {
float: left;
width: 30%;
height:50%;
margin-left: 0;

}
div.leftmargin p {
text-align: center;
font-style: bold;
font-size: smaller;
text-indent: 0;

}
</style>
</head>
<div class="leftmargin" >
<p>
We have large number of tutorials on java which will help you learn java in better way. You will find these links very useful.
<p><a href=#>Core Java</a><br>
<a href=#>JSP</a><br>
<a href=#>Servlet</a><br>
<a href=#>JDBC</a><br>
<a href=#>Hibernate</a><br>
<a href=#>Struts</a><br>
<a href=#>Spring</a><br>
<a href=#>EJB</a><br>
<a href=#>J2ME</a>
</p>
</p>
</div>
</html>


June 8, 2010 at 4:25 PM


continue..

4)index.jsp:

<%@ include file="header.html"%>
<%@ include file="left.html"%>
<style>
div.form {
float: right;
width: 30%;
height:50%;
margin-right: auto;
}
div.form table {
text-align: center;
font-style: bold;
font-size: smaller;
text-indent: 0;

}
</style>

<div class="form">
<table>
<tr><th>Ask Question?</th><th>Register with us</th></tr>
<tr><td>First Name:</td><td><input type="text" name="firstname" size="20"></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lastname" size="20"></td></tr>
<tr><td>User Name:</td><td><input type="text" name="username" size="20"></td></tr>
<tr><td>Password:</td><td><input type="password" name="password" size="20"></td></tr>
<tr><td>Contact No </td><td><input type="text" name="contact" size="20"></td></tr>
<tr><td>Email: </td><td><input type="text" name="email" size="20"></td></tr>
<tr><td>Address </td><td><input type="text" name="address" size="20"></td></tr>
<tr><td><input type="submit" value="Submit" name="B1"></td><td><input type="reset" value="Reset" name="B2"></td></tr>
</table>
</div>

<%@ include file="footer.html"%>

Hope that it will be helpful for you.
Thanks


June 8, 2010 at 10:21 PM


Everything is working fine, except the footer.jsp. It is overlapping on the space below header when implemented in index.jsp. I'm using RAD 7.5 to run my JSP.

let me know how to fix it.


Related Tutorials/Questions & Answers:
styling jsp - JSP-Servlet
styling jsp   Hi, I need to style my jsp file, to have a header... jsp for each of those(header,footer and left margin). I'm doing this for header...; } Our site contains several useful examples and applications of Java, JSP
jsp
jsp  how to include two jsp page
Advertisements
Jsp
Jsp  Can I implement interface in jsp
jsp
jsp  how to create jsp page
JSP
JSP  How to run jsp program in eclipse
jsp
jsp  how jsp translated into servlets
JSP
what is JSP forward tag for  what is JSP forward tag for   It forwards the current request to another JSP page. Below is the syntax for the same:- <jsp:forward page="...url..." /> We can also forward parameter
jsp
jsp  write a code for jsp file generator to generate a jsp page automatically taking html page as input
jsp
jsp  how to create a table in oracle using jsp and the table name is entered in text feild of jsp page
JSP
JSP  Hi, What is JSP? What is the use of JSP? Thanks   Hi, JSP Stands for Java Server Pages. It is Java technology for developing web applications. JSP is very easy to learn and it allows the developers to use Java
jsp
jsp   what is the basic necessities reguired for running jsp using JDBC bridge?? and how to write a jsp code to access the detail present in microsoft access pls send link regarding above
jsp
jsp  how to connect the database with jsp using mysql   Hi Friend, Please visit the following links: http://www.roseindia.net/jsp/connectjspwith_mysql.shtml http://www.roseindia.net/jsp/Accessingdatabase-fromJSP.shtml
jsp
jsp  how to upload image through csv format in jsp
jsp
jsp  I Want complete note on JSP servlet
jsp
jsp  how to delete data from database using jsp
jsp
jsp  code for jsp automatic genration using html
jsp
jsp  why jsp is translated into servlet?pls describe precisly
JSP
JSP  relevant difference between servlet and jsp in 1 line
jsp
jsp  how to write a servlet and jsp program for user login form
jsp
jsp  how to write a servlet and jsp program for user login form
JSP
JSP   How to create CAPTCHA creation by using JSP? I need an code for CAPTCHA creation by using JSP...   You can create a captcha validation using jsp. Have a look at the following tutorial: Captcha Creation
jsp
jsp  how to include google map in our jsp page
JSP
JSP  FILE UPLOAD-DOWNLOAD code USING JSP
jsp
jsp  how to write hindi in jsp and store in database as unicode
jsp
jsp  how to pass jsp variable to an html page
JSP
What are JSP directives, page directives and include directives?  what are jsp directives? and what are page directives? and what are include directives? can you explain taglib directives?   JSP directives JSP
JSP
Can you explain jsp page life cycle what is el how does el search for an attribute in JSP  Can you explain jsp page life cycle what is el how does el...://www.roseindia.net/jsp/simple-jsp-example/LifeCycleOfJspPage.shtml http
JSP
JSP  what are the different scopes an object can have in a jsp page   JSP Scope Variables: Page scope-It makes the data available... the following links: http://www.roseindia.net/jsp/simple-jsp-example
JSP
what is jstl in JSP   what is jstl   JSTL is also called as JSP tag libraries. They are collection of custom actions which canbe accessed as JSP tags. For more information, visit the following link: JSTL Tutorials
JSP
access application data stored in JavaBeans components. The jsp expression...). Before JSP 2.0, we could use only a scriptlet, JSP expression, or a custom tag to include server state in the jsp page output. For more information, visit
JSP
JSP public opinion poll   Develop a JSP for a news channel to conduct public opinion poll on any topic. Users will respond through yes or no options. Later display the result in percentage
Advertisements
 

 

 

DMCA.com