how to include a java class in jsp

how to include a java class in jsp

View Answers

August 1, 2008 at 6:01 PM

Hi friend,

<HTML>
<HEAD>
<TITLE>Using an if-else</TITLE>
</HEAD>

<BODY>
<H1>Using an if-else</H1>
<%
String day = "Friday";

if(day == "Monday")
out.println("It\'s Monday.");
else if (day == "Tuesday")
out.println("It\'s Tuesday.");
else if (day == "Wednesday")
out.println("It\'s Wednesday.");
else if (day == "Thursday")
out.println("It\'s Thursday.");
else if (day == "Friday")
out.println("It\'s Friday.");
else if (day == "Saturday")
out.println("It\'s Saturday.");
else if (day == "Sunday")
out.println("It\'s Sunday.");
%>
</BODY>
</HTML>


----------------------------------------------------------------


Read for more information.

http://www.roseindia.net/jsp/

Thanks.

Ads









Related Tutorials/Questions & Answers:
how to include a java class in jsp - JSP-Servlet
how to include a java class in jsp  hello sir, this is my first question, i want know that how to use a java class function's variables and methods of a java class in jsp.if possible plz tr to explain with a simple example
How To Include Two Jsp page in another jsp page?
How To Include Two Jsp page in another jsp page?  I use following code to Include Two Jsp Page Header and footer <%@include file="header.jsp... the following links: http://www.roseindia.net/jsp/jsp-include-file.shtml http
Advertisements
Creating dynamic jsp file in java file to include another jsp file
Creating dynamic jsp file in java file to include another jsp file  I am able to create jsp file in java that includes ; table tr td and img tags..... Need to include jsp file in the same content. The below code doesn't help me
Java to create table in jsp file that include other jsp file
Java to create table in jsp file that include other jsp file  String jspContent = "table" += "tr" += "td" += "jsp:include page='fileSource... this http://www.roseindia.net/tutorial/java/core/files/javacreatetableinHTML.html
How to include?
How to include?  How can we include a JSP file in one application to the JSP file in another application which are in the same server?? please help me out with code
include a jsp file
include a jsp file   Sir, I have 2 jsp pages. I want to include second jsp in the first jsp page when a button in the first jsp is clicked. how can I do this. I tried in sevaral ways . I am using jsp and javascript... anyone
how to pass variable from simple java main class(not servlet) to the jsp page?
how to pass variable from simple java main class(not servlet) to the jsp page?  I have a simple Java class in which I invoke a call to a JSP page... from the simple Java class to the JSP page. How can I do that? Here is my
Java class in JSP
Java class in JSP          To use a Java class method in jsp first we need to import a package inside which there is java class. We will import the package
How to validate a form in action class and forward errors to the jsp in struts?
How to validate a form in action class and forward errors to the jsp in struts?  How to validate a form in action class and forward errors to the jsp in struts
Dynamic include jsp
Dynamic include jsp  I need dynamic include jsp page with an example
JSP Include jsp
JSP Include jsp   ... include either a static or dynamic file in a JSP file. If the file is static, its...;Includes Jsp Page</h2> <jsp:include page="includedJsp.jsp" >
How can i pass the valus from a JSP to the action class???
How can i pass the valus from a JSP to the action class???  hewllo wevryone... can anyone help me with how i can pass the value of menuId in my JSP and pass it in the action class
Include Static HTML Page in JSP
Include Static HTML Page in JSP       This example shows how to include static html page in jsp. In JSP, there are two ways to include another web resource. 1
jsp using include & with mysql
jsp using include & with mysql  Sir, I am creating a login application using jsp & Mysql. The Codes are--- Html File...... <...; Jsp file....... <%@ page import="java.sql.*" %> <% String
jsp:include action tag
jsp:include action tag In this section we will discuss about JSP "include" action tag. The jsp "include" tag is used to include... into Servlet. The include tag is used to include another resource it may be jsp
how to send my system.out.println in a class file to a jsp in Struts2
how to send my system.out.println in a class file to a jsp in Struts2   System.out.println("File" + f + " contains text " + text... to sent this to a JSP page
How to create a class in java
How to create a class in java  I am a beginner in programming and tried to learn how to do programming in Java. Friends please explain how can I create a class in Java
The Include Directive in JSP Page
directive of the JSP. You will learn about what is include and how to implement... The Include Directive in JSP Page   ...; <%@include file="relativeURL" %> <jsp:include page="
JSP Include File
JSP Include File          JSP Include File is used to insert a html... to include a html file in the jsp page. You can see in the given example that we
JSP include
JSP include       A JSP page can include page fragments from other files to form the complete... the action:   <jsp:include page=" relative URL" flush="true"
JSP Include Param
JSP Include Param          JSP Include Param is used to pass parameter in the include directive. The example uses <jsp:param> clause to pass
How to pass Array of string from action class to jsp page
How to pass Array of string from action class to jsp page  this is my action class package login.ipm; import java.sql.*; import java.util.ArrayList... class DiagservicesAction extends org.apache.struts.action.Action { private static
how to pass string array from action class to jsp page? pls reply me.
how to pass string array from action class to jsp page? pls reply me.  how to pass string array from action class to jsp page? pls reply me.  ...;but, we can not use java code in jsp. with out using java code in jsp
How to use Java Beans in JSP?
How to use Java Beans in JSP?  Hi, I have developed a employee bean in Java: public class Employee{ private String name; private String code; ..... } Please tell me how I can use Employee Java bean in JSP page? Thanks
how to get session object in simple java class??
how to get session object in simple java class??  i am fallowing...) GroupDetailsDao.java (it is also a simple java class which have the jdbc logic... java class (GroupDetailsDao.java) please help me
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
How do I decompile Java class files?
How do I decompile Java class files?  How do I decompile Java class files
Passing Parameter with <jsp: include>
--> <jsp:include page="AccessincludedParameter.jsp"> <jsp...Passing Parameter with <jsp: include>      In this example we are going to use <jsp:include>
How to include a File using directive and include action
How to include a File using directive and include action... one attribute named as file, which is used to include a file in the jsp page..., whether it is a html, xml or any jsp page we should use include directive
JSP bean get property
bean get property. In this example we define a package bean include a class... is used to give the reference of the bean class. <jsp:get Property>... JSP bean get property   

Ads