invoking session with Direct Action

Yamuna Vallipuram <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hi..

I am having problems invoking a session in DA method. My Session.java  
class has a login method which invokes a url with the direct action  
method registreringAction which is defined in DirectAction.java  
class.The registreringAction in DirectAction.java simply returns the  
PersonImport page component. When I access the session 
().getAktualInst in PersonImport .java class the session is null  
(existingSession()).

It seems to me that when  I instantiate a WOComponent (PersonImport)  
it looses all the session information. What am I doing wrong??

Any help will be highly appreciated.

Here is my code...

DirectAction.java
------------------------------------------------------------------------ 
----------------------------------------------------
public WOActionResults registreringAction() {
if (!getApplication().dbErProdbase) {
     		String deaktiverFeideAsString = stripAnker((String) request 
().formValueForKey("feide"));
     			if (deaktiverFeideAsString != null &&  
deaktiverFeideAsString.equals("false")) {
     				getSession().deaktivereFeide = true;
     			} else {
     				getSession().deaktivereFeide = true;
     		}
     	}
	AppComponent nesteSide;
     	if ( getSessionIDForRequest(request()) != null &&  
existingSession() == null ) {
     	nesteSide = (AppComponent) pageWithName ("PersonImport1");
     	return nesteSide;
     	 } else {
     		 System.out.println("ingen session");
     		 nesteSide = (AppComponent) pageWithName ("Main");
     		 return nesteSide;
     	 }
     } 	


PersonImport1.java
------------------------------------------------------------------------ 
------------------------------------------------------
public String getAktuellInst() {
     		aktuellInst = (getSession().getValgtInstitusjon());
return aktuellInst;
     }


Application.java
------------------------------------------------------------------------ 
-----------------------------------------------------
  public Application() {
         super();
setDefaultRequestHandler(requestHandlerForKey 
(this.directActionRequestHandlerKey()));

}


Session.java
------------------------------------------------------------------------ 
--------------------------------------------------
public WOComponent sendInnloggingTilFeide() {
	        try {
	            // Ber Feide kontakte oss p 'https' slik at vi slupper  
problematikk
	            // om at man ellers fÂr en redirect i retur.
	            String fridaURL =
	                UIOApplication.getFullUrlForApplication(context 
().request(), true)
	                    + "/wa/registrering?moriaID=";
	
	            // Dette er det eneste attributtet vi fÂr hente fra Moria.
	            String moriaURL =
	                getMoriaStub().initiateAuthentication(
	                    new String[] {"norEduPersonNIN"}, fridaURL, "",  
false);
	            if (moriaURL == null || moriaURL.length() == 0) {
	                throw new RemoteException("Ingen moria-url ble  
returnert!");
	            }
	
	            WORedirect redirect = new WORedirect(context());
	            redirect.setUrl(moriaURL);
	            return redirect;
	        } catch (Exception e) {
	            if (e.getMessage() != null && e.getMessage().indexOf 
("NoSuchSessionException") != -1) {
	                logger.warn("FEIDE-feil: NoSuchSessionException");
	                leggTilFeilmelding("Din Feide-sesjon har gÂtt ut p  
tid. Pr¯v  logge inn p nytt. " +
	                                   "Kontakt systemeier hvis  
problemet vedvarer.");
	            } else {
	                logger.warn("FEIDE-feil: " + e);
	                leggTilFeilmelding("Det var problemer med  
kommunikasjonen mot Feide. " +
	                                   "Kontakt systemeier hvis  
problemet vedvarer.");
	            }
	            return null;
	        }
	    }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.