This is not really a Jserv related issue, it is better asked in

[EMAIL PROTECTED]


--Original Message Text---
From: [EMAIL PROTECTED]
Date: Tue, 8 Aug 2000 16:25:50 +0100

----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------


I have the follow problem.
I put a string in servlet session and then i try to read the value from a jsp page.
When i get the objet session within jsp page I obtain a null value. here is the servlet and jsp source code.


// -*- mode: java -*-
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;

public final class insIntoSession extends HttpServlet implements CostantiServlet
{
private HttpSession session = null;
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
String saluti = new String("Ciao Salvatore");
session = req.getSession(false);
try
{

if (session == null)
log("Non sono riuscito a creare la sessione ");
else
log("Inserisco nella sessione il valore "+saluti);

session.putValue("insIntoSession.saluti",saluti);
res.sendRedirect("/sgti/jsp/vediSessione.jsp");
}
catch(Exception e)
{
throw new UnavailableException(this,DB_ERROR_CONNECTION);
}
}

/**
* Before dying out...
*/
public void destroy() {
log("Servlet insIntoSession distrutta.");
}

}



<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page session="false" %>

Vedi Sessione JSP Non era presente nessuna sessione
Non ci sono saluti per te
Ecco i tuoi saluti






Tanks in advance salvatore

--------------------------------------
Name: Salvatore Soldatini
E-mail: [EMAIL PROTECTED]
Tel.: (06)71036892
Date: 08/08/00
Time: 14:23:20
--------------------------------------




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]


Reply via email to