JSF2 – Bean Method Call With Parameter

Un metodo di un bean può ricevere in input parametri da una pagina jsf:
#{bean.method(param)}
Questa  sintassi funziona con Tomcat 7, perchè supporta le EL 2.2 (el-impl-2.2.jar).

passParameter.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
 xmlns:f="http://java.sun.com/jsf/core"
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:ui="http://java.sun.com/jsf/facelets"
 xmlns:p="http://primefaces.org/ui"
 xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head/>
<h:body>
 <h:form>
<h:commandButton action="#{passParameterBean.getParameter(gigi)}" />

 </h:form>
</h:body>
</html>
PassParameter.java
package com;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean
@SessionScoped
public class PassParameterBean {
 
 private String name;

 public String getName() {
  return name;
 }

 public void setName(String name) {
  this.name = name;
 }
 
 
 public String getParameter(String name)
 {
  this.name = name;
  
  return "./passParameterResult.xhtml";
 }

}

PassParameterResult.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
 xmlns:f="http://java.sun.com/jsf/core"
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:ui="http://java.sun.com/jsf/facelets"
 xmlns:p="http://primefaces.org/ui"
 xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head />
<h:body>
 <h:form>
  <h:outputText value="#{passParameterBean.name}" />

 </h:form>
</h:body>
</html>


JSF2 Primefaces – p:galleria Example

p:galleria è un tag per la visualizzazione delle immagini:

<p:galleria value=”#{galleriaBean.images}” var=”image” >
    <p:graphicImage value=”/resources/images/#{image}” />
</p:galleria>

Si hanno a disposizione vari effetti:
http://primefaces-rocks.appspot.com/ui/galleria.jsf

Bean java e pagina xhtml

galleria.xhtml

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”
xmlns:f=”http://java.sun.com/jsf/core”
xmlns:h=”http://java.sun.com/jsf/html”
xmlns:ui=”http://java.sun.com/jsf/facelets”
xmlns:p=”http://primefaces.org/ui”
xmlns:c=”http://java.sun.com/jsp/jstl/core”>
<h:head/>
<h:body>
<h:form>
<h3>Images1 </h3>  
<p:galleria value=”#{galleriaBean.images}” var=”image” panelWidth=”500″ panelHeight=”313″ effectSpeed=”1000″>  
    <p:graphicImage value=”/resources/images/#{image}” />  
</p:galleria>  
  
<h3>Custom Content</h3>  
<p:galleria id=”contentGalleria” value=”#{galleriaBean.players}” var=”player” panelWidth=”250″ panelHeight=”300″  
            frameWidth=”48″ frameHeight=”65″ effect=”clip”>  
  
    <p:graphicImage id=”playerImage” value=”/resources/images/#{player.photo}” alt=”#{image}” title=”#{player.name}”/>  
    <f:facet name=”content”>  
        <h:panelGrid  columns=”2″ cellpadding=”5″>  
            <f:facet name=”header”>  
                <p:graphicImage value=”/resources/images/#{player.photo}” />  
            </f:facet>  
  
            <h:outputText value=”Name: ” />  
            <h:outputText id=”name” value=”#{player.name}”/>  
  
            <h:outputText value=”Number ” />  
            <h:outputText id=”number” value=”#{player.number}”/>  
  
            <h:outputText value=”Position ” />  
            <h:outputText id=”position” value=”#{player.position}”/>  
        </h:panelGrid>  
    </f:facet>  
  
</p:galleria>  
 </h:form>
</h:body>
</html>

GalleriaBean.java

package com;

import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.AjaxBehaviorEvent;

import java.util.ArrayList;  
import java.util.List;  
import javax.annotation.PostConstruct;  

@ManagedBean
@SessionScoped
public class GalleriaBean {  
  
    private List<String> images;  
  
    private List<Player> players;  
  
    private Player selectedPlayer;  
  
    @PostConstruct  
    public void init() {  
        images = new ArrayList<String>();  
  
        for(int i=1;i<=12;i++) {  
            images.add(“photoProfile.png”);  
        }  
  
        players = new ArrayList<Player>();  
  
        players.add(new Player(“Messi”, 10, “photoProfile.png”, “CF”));  
        players.add(new Player(“Iniesta”, 8, “photoProfile.png”, “CM”));  
        players.add(new Player(“Villa”, 7, “photoProfile.png”, “CF”));  
        players.add(new Player(“Xavi”, 6, “photoProfile.png”, “CM”));  
        players.add(new Player(“Puyol”, 5, “photoProfile.png”, “CB”));  
    }  
  
    public Player getSelectedPlayer() {  
        return selectedPlayer;  
    }  
  
    public void setSelectedPlayer(Player selectedPlayer) {  
        this.selectedPlayer = selectedPlayer;  
    }  
  
     
    public List<String> getImages() {  
        return images;  
    }  
  
    public List<Player> getPlayers() {  
        return players;  
    }  
}  
  


Esecuzione
Deployando e, da browser, chiamando l’url:

http://localhost:8080/JSFProject/faces/galleria.xhtml

si ottiene:

JSF2 – Load Properties File Dentro Bean

Legge un file di properties (configurationFBM) da dentro un Backing Bean:

package com;

import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.AjaxBehaviorEvent;

@ManagedBean
@SessionScoped
public class GalleriaBean {

private ResourceBundle configurationFBM;
private String pathFileUser;

@PostConstruct
public void init() {
FacesContext context = FacesContext.getCurrentInstance();
configurationFBM = context.getApplication().getResourceBundle(context,
“configurationFBM”);
if (this.configurationFBM != null) {
this.pathFileUser = configurationFBM.getString(“pathFileUser”);
}

}

public String getPathFileUser() {
return pathFileUser;
}

public void setPathFileUser(String pathFileUser) {
this.pathFileUser = pathFileUser;
}

}

Java Read Properties File Servlet

Ipotizzando che il file di properties si trovi sotto 

web-infclassescomprova.properties

dentro la servlet è sufficiente la seguente istruzione

ResourceBundle handlers = ResourceBundle.getBundle(“com.prova”);

Spring 3 @autowired Esempio


@autowired è usata per iniettare direttamente i valori configurati nell’xml nel bean.
Si puo usare  sul metodo set, costruttore o direttamente sul campo.

Bean
Bean dichiarato nel file xml con un solo  campo msg.

package com;

public class Message {

private String author;
private String body;

public String getAuthor() {
return author;
}

public void setAuthor(String author) {
this.author = author;
}

public String getBody() {
return body;
}

public void setBody(String body) {
this.body = body;
}

}

applicatioContext.xml
<beans xmlns=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:context=”http://www.springframework.org/schema/context”
xsi:schemaLocation=”http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd”
xmlns:util=”http://www.springframework.org/schema/util”>

<context:component-scan base-package=”com” />

<bean id=”provaBean” class=”com.ProvaBean”>

</bean>
<bean id=”message” class=”com.Message”>
<property name=”msg” value=”Hello World” />
<property name=”author” value=”Pippo” />
</bean>

</beans>


Abilitazione Annotazione
Per usare @autowired si deve registrare AutowiredAnnotationBeanPostProcessor. Questo si può fare in due modi:
1) si aggiunge
   <context:annotation-config />    
dentro applicationContext.xml
2) si aggiunge:
   <bean class=”org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor”/> dentro applicationContext.xml  
@autowired Esempi
@autowired su campo

ProvaBean.java
package com;

import org.springframework.beans.factory.annotation.Autowired;

public class ProvaBean {
@Autowired
private Message message;

public Message getMessage() {
return message;
}

public void setMessage(Message message) {
this.message = message;
}


}

@autowired sul metodo set

ProvaBean.java
package com;

import org.springframework.beans.factory.annotation.Autowired;

public class ProvaBean {

private Message message;

public Message getMessage() {
return message;
}

@Autowired
public void setMessage(Message message) {
this.message = message;
}


}


@autowired sul costruttore

ProvaBean.java
package com;

import org.springframework.beans.factory.annotation.Autowired;

public class ProvaBean {

private Message message;

@Autowired
public ProvaBean(Message msg)
{
message = msg;
}

public Message getMessage() {
return message;
}

public void setMessage(Message message) {
this.message = message;
}


}



Esecuzione Test

TestBean.java
package com;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestBean {

public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
“applicationContext.xml”);

ProvaBean obj = (ProvaBean) context.getBean(“provaBean”);
System.out.println(obj.getMessage().getBody());
System.out.println(obj.getMessage().getAuthor());
}

}


avviando il main si otterrà, in tutte e tre casi, il seguente output:

Java Reflection Esempio

Copiare due classi diverse ma con gli stessi campi tramite la reflection

Bean 

A.java

package com;

import java.lang.reflect.Field;

public class A {
private String name;

private long punteggio;

public long getPunteggio() {
return punteggio;
}

public void setPunteggio(long punteggio) {
this.punteggio = punteggio;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

}

B.java

package com;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class B {
private String name;

private long punteggio;

public long getPunteggio() {
return punteggio;
}

public void setPunteggio(long punteggio) {
this.punteggio = punteggio;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public void copy(Object obj) {
try {

Method[] methods = obj.getClass().getMethods();

for (int i = 0; i < methods.length; i++) {
String methodName = methods[i].getName();
try{
if(methodName.startsWith(“get”)){
this.getClass().getMethod(methodName.replaceFirst(“get”, “set”) , methods[i].getReturnType() ).invoke(this, methods[i].invoke(obj, null));
}else if(methodName.startsWith(“is”) ){
this.getClass().getMethod(methodName.replaceFirst(“is”, “set”) ,  methods[i].getReturnType()  ).invoke(this, methods[i].invoke(obj, null));
}

}catch (NoSuchMethodException e) {
// TODO: handle exception
}catch (IllegalArgumentException e) {
// TODO: handle exception
}

}

} catch (Exception ex) {
ex.printStackTrace();
}
}

}


Classe per il test:
TestReflection.java
package com;
public class TestReflection {
public static void main(String[] args) {
A obj1 = new A();
obj1.setName(“hello world”);
A obj2 = new A();
obj2.copy(obj1);
System.out.println(“name obj copy with reflection:”+obj2.getName());
}
}
Esecuzione
lanciando il main si ottiene una copia identica dell’istanza obj1:

Spring 3 Bean Example

Configurazione
Mettere il seguente file dentro la cartella resources.

applicationContext.xml

<beans xmlns=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:context=”http://www.springframework.org/schema/context”
xsi:schemaLocation=”http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd”
xmlns:util=”http://www.springframework.org/schema/util”>

<context:component-scan base-package=”com” />

  <bean id=”provaBean” class=”com.ProvaBean”>
</bean>
</beans>

Bean Spring
creare un file java di nome ProvaBean nel package “com”
ProvaBean.java
package com;
public class ProvaBean {
private String msg = “HelloWord”;
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
creare un file java di nome TestBean:
TestBean.java
package com;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class TestBean {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
“applicationContext.xml”);
ProvaBean obj = (ProvaBean) context.getBean(“provaBean”);
System.out.println(obj.getMsg());
}
}

Esecuzione
lanciare il main del file TestBean. L’ouput sarà:

java.lang.ClassNotFoundException: org.apache.myfaces.webapp.StartupServletContextListener JSF 2

Eccezione:


<span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">SEVERE</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Error</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> configuring application listener of </span><span style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">class</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">myfaces</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">webapp</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StartupServletContextListener</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">lang</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">ClassNotFoundException</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">myfaces</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">webapp</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StartupServletContextListener</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">loader</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">WebappClassLoader</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">loadClass</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">WebappClassLoader</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">1387</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">loader</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">WebappClassLoader</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">loadClass</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">WebappClassLoader</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">1233</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">core</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardContext</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">listenerStart</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardContext</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">3786</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">core</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardContext</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardContext</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">4342</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">core</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">ContainerBase</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">ContainerBase</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">1045</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">core</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardHost</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardHost</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">719</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">core</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">ContainerBase</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">ContainerBase</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">1045</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">core</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardEngine</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardEngine</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">443</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">core</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardService</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardService</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">516</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">core</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardServer</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">StandardServer</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">710</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">startup</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">578</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at sun</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">reflect</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">NativeMethodAccessorImpl</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">invoke0</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Native</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Method</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at sun</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">reflect</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">NativeMethodAccessorImpl</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">invoke</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">NativeMethodAccessorImpl</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">39</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at sun</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">reflect</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">DelegatingMethodAccessorImpl</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">invoke</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">DelegatingMethodAccessorImpl</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">25</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">lang</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">reflect</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Method</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">invoke</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Method</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">597</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">startup</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Bootstrap</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">start</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Bootstrap</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">288</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><br />    at org</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">apache</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">catalina</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">startup</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Bootstrap</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">main</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">Bootstrap</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">java</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">413</span><span style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span>

Soluzione:
Mancano alcuni jar delle MyFaces. Scaricare i file da qui e metterli nella cartella /WEB-INF/lib

Read Write File With InputStream OutputStream Java

Le istruzioni che leggono  il  file con InputStream sono:

InputStream inputStream = new FileInputStream(“c:/myFile.txt”);
inputStream.read(bytes);

Per scrivere su un file con OutputStream:

OutputStream outputStream = new FileOutputStream(new File(“c:/myFileNew.txt”));
outputStream.write(bytes, off, len);// scrive un array di byte di  lunghezza len a partire da posizione off

Esempio completo:

package com;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class InputStreamToFile {
    public static void main(String[] args) {

InputStream inputStream = null;
OutputStream outputStream = null;

try {
inputStream = new FileInputStream(“c:/myFile.txt”);

// write the inputStream to a FileOutputStream
outputStream = new FileOutputStream(new File(“c:/myFileNew.txt”));

int read = 0;
byte[] bytes = new byte[1024];

while ((read = inputStream.read(bytes)) != -1) {
outputStream.write(bytes, 0, read);
}

System.out.println(“Done!”);

} catch (IOException e) {
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (outputStream != null) {
try {
// outputStream.flush();
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}

}
}
    }
}

f:ajax with f:param, JSF2

f:ajax è un tag JSF che aggiunge il meccanismo delle request asincrone a molti componenti UI. 
Per passare dei parametri viene aggiunto il tag f:param
pagina con supporto ajax:


ProvaAjax.xhmtl

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”
xmlns:f=”http://java.sun.com/jsf/core”
xmlns:h=”http://java.sun.com/jsf/html”
xmlns:ui=”http://java.sun.com/jsf/facelets”
xmlns:p=”http://primefaces.org/ui”
xmlns:c=”http://java.sun.com/jsp/jstl/core”>
<h:head/>
<h:body>
<h:form>
<input type=”hidden” name=”id2″ id=”id2″ value=”55″ />
<h:commandLink value=”ssss”>
<f:param name=”id” value=”44″ />
<f:ajax listener=”#{galleriaBean.countListener}”>

</f:ajax>
</h:commandLink>

</h:form>
</h:body>
</html>


nel tag f:ajax:
            – execute=”name”, indica che il componente con id “name” deve essere mandato al server.
            – render=”output”, indica che il componente con id “output” dovrà, dopo la request ajax, essere aggiornato.
            – listener=“#{provaTag.handleEvent}”, indica il metodo del bean da chiamare.


GalleriaBean.java

package com;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.AjaxBehaviorEvent;

@ManagedBean
@SessionScoped
public class GalleriaBean {

public void countListener(AjaxBehaviorEvent event) {
System.out.println(“test:”);
String id = FacesContext.getCurrentInstance().getExternalContext()
.getRequestParameterMap().get(“id”);
System.out.println(“id:” + id);
}

}

aprendo l’indirizzo: http://localhost:8080/JSFProject/faces/ProvaAjax.xhtml



cliccando sul link “sss” si entra dentro il listener che scrive sulla console: