Passing Console output from java to jsp

Passing Console output from java to jsp

Step 1: Create and paste the below code,


package com.agn;

public class Hello {

	 * @param args
	public String returning(){
		String go = "hello Naveen";
		return go;

	public static void main(String[] args) {
		Hello h = new Hello();



Step 2: Create fethingfromjava.jsp and paste the below code,


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<%@ page import="com.agn.Hello" %>
<% Hello hjsp = new Hello();
String got = hjsp.returning();



Step 3: Ouput

You can see Hello Naveen output in jsp page.

3,261 total views, 1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.