I have tried the following in my Maven project:
Add a markdown file content.md with content
```java
int a = 4;
```
in src/main/site/markdown.
Write a site.xml with content
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.7</version>
</skin>
<body>
<menu name="Dokumentation">
<item name="Benutzerhandbuch" href="content.html" />
</menu>
<menu ref="reports" />
</body>
</project>
Write a pom.xml with
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.continentale.testsvn</groupId>
<artifactId>site-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-xhtml</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Now I get a file content.html from mvn site. In this file, the int a = 4 is not syntax highlighted.
What do I need to do to get syntax highlighting?
I couldn't get it to work with Maven either but I found a workaround: Do the highlighting client-side in Javascript with highligh.js.
Download highlight.js and place it under src/site/resources/highlightjs.pack.js, as well as a CSS theme, e.g. src/site/resources/styles/atom-one-light.css.
In your site descriptor:
<project>
<body>
<head>
<![CDATA[
<link rel="stylesheet" href="styles/foundation.css" />
<script src="highlight.pack.js"></script>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
document.querySelectorAll('pre.source').forEach((block) => {
hljs.highlightBlock(block);
});
});
</script>
]]>
</head>
</body>
</project>
Maven generate <pre class="source" /> blocks for code blocks so we need to tell that to highlight.js. Unfortunately Maven doesn't put a class name corresponding to the language (Java in your example) but highlight.js auto-detects languages and that works in most cases.
Related
after trying multiple times on freemarker to work, I switched to thymeleaf and also faced the same problem. When returning the html file, it's just a string value and not the html file in the templates folder.
I don't know why it doesn't even start in console, when I watched youtube thymeleaf videos it shows in their console.
package com.example.demo;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
#RestController
public class controller {
#GetMapping
public String getUser(Model model) {
model.addAttribute("something", "welcome to the club");
return "user";
}
}
here is the html file in main/resources/templates
<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Code</title>
</head>
<body>
<h1 th:text="${something}"></h1>
</body>
</html>
POM.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Solved now, I replace #RestController with #Controller because #RestController adds #ResponseBody and prevents to get the view.
I get error like this when I used thymeleaf as view engine.
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sat Feb 13 15:57:19 EET 2021
There was an unexpected error (type=Not Found, status=404).
No message available
My MainCotroller is like :
public class MainController {
#RequestMapping("/")
public ModelAndView homePage(){
ModelAndView homepage=new ModelAndView("homepage");
homepage.addObject("username","Ayberk");
return homepage;
}
}
My homepage.html file is like this:
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<!--/*#thymesVar id="username" type="String"*/-->
<p th:text="${username}"></p>
<br />
<p>GoodBye</p>
</body>
</html>
My pom.xml file is like this:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>newproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>newproject</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>
My idea is Intellij 2020 and I have read this problem is related with intellij version. But i have not seen any solution. Is there any solution for it? What can i do?
EDIT AFTER RUDI'S ANSWER BUT STILL SAME ERROR.
#RequestMapping("/")
public String homePage(Model model){
model.addAttribute("username" , "ayberk");
return "src\\main\\resources\\templates\\homepage";
//return "homepage"; also tried like this.
}
My ModelAndView packages is org.springframework.web.servlet.ModelAndView
I created just a simle springBoot application,and I want when i lunch
my application it retun me my jsp page in my browser. but when I type
localhost:8080 in my browser it return me this type of error"There was
an unexpected error (type=Not Found, status=404)."I added jasper
dependency got same error,I use jsp api dependency in place jasper i
got same error.
what is the reason i am not getting jsp page as a result,why it throws
error404
this type of error
project file strcture
HomeController.java
package com.main.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
public class HomeController {
#RequestMapping("/")
public String host() {
return "Katak.jsp";
}
}
Katak.jsp
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Welcome to security World
</body>
</html>
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.8.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.main</groupId>
<artifactId>BasicSecurity-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>BasicSecurity-2</name>
<description>Demo project for SpringSecurity</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-jasper -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>8.5.37</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Make sure that you are using proper jsp names, in project structure, jsp name is showing as "Katakile.jsp". But in controller you are returning "Katak.jsp".
If names are proper and still not working, please use "tomcat-embed-jasper" dependency instead of "tomcat-jasper" and remove the tomcat-jasper dependency from your classpath, if exists.
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>8.5.6</version>
<scope>provided</scope>
</dependency>
Just edit this line
#RequestMapping("/katak")
public String host() {
return "/Katakile.jsp";
}
And try acces localhost:8080/katak
I downloaded my project from start.spring.io and the folder structure is as it appears in the picture and I can not add special-title.html page to home.jsp page.
I use the following commands for integration.
<jsp:include page="/WEB-INF/jsp/special-title.html"></jsp:include>
<jsp:include page="../WEB-INF/jsp/special-title.html"></jsp:include>
<jsp:include page="${pageContext.request.contextPath}/WEB-INF/jsp/special-title.html"></jsp:include>
However, I could not run these commands. Where am I making a mistake?
Picture of project folder structure
POM.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
application.properties
server.port=7070
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
DemoController.java
package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
#Controller
public class DemoController {
#GetMapping("/home")
public String showHomePage() {
return "home";
}
}
home.jsp
<%# page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<jsp:include page="/WEB-INF/jsp/special-title.html"></jsp:include>
<h1>HELLO WORLD</h1>
</body>
</html>
special-title.html
<h2>SPECIAL TITLE</h2>
Testing Url
http://localhost:7070/home
First move your special-title.html from WEB-INF to templates folder which is under resources.
Then in jsp file try adding line <%# include file="resources/templates/special-title.html"%> instead of <jsp:include page="/WEB-INF/jsp/special-title.html"></jsp:include>
To run html as jsp you can do one thing. Write a web.xml inside WEB-INF like this
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<jsp-config>
<jsp-property-group>
<url-pattern>*.html</url-pattern>
</jsp-property-group>
</jsp-config>
</web-app>
This question already has answers here:
Identifying and solving javax.el.PropertyNotFoundException: Target Unreachable
(18 answers)
Closed 4 years ago.
I'm on the verge of going crazy.
My goal was to change JSF-Managed-Beans to CDI-Managed-Beans.
I thought it was just changing Annotations. It wasn't.
I've read a lot - and more. But I just can not find my mistake.
I get this Exception:
javax.faces.FacesException: javax.el.PropertyNotFoundException: //C:/01_java/ws_bsp/bsp/bsp-web/src/main/webapp/jsf/allgemein/login.xhtml #29,86 value="#{logInOutController.username}": Target Unreachable, identifier 'logInOutController' resolved to null
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:273)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:57)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1193)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
Truncated. see log file for complete stacktrace
Caused By: javax.el.PropertyNotFoundException: //C:/01_java/ws_bsp/bsp/bsp-web/src/main/webapp/jsf/allgemein/login.xhtml #29,86 value="#{logInOutController.username}": Target Unreachable, identifier 'logInOutController' resolved to null
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
at org.primefaces.util.ComponentUtils.getConverter(ComponentUtils.java:152)
at org.primefaces.renderkit.InputRenderer.getConvertedValue(InputRenderer.java:199)
at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1045)
at javax.faces.component.UIInput.validate(UIInput.java:975)
Truncated. see log file for complete stacktrace
Caused By: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'logInOutController' resolved to null
at com.sun.el.parser.AstValue.getTarget(AstValue.java:173)
at com.sun.el.parser.AstValue.getType(AstValue.java:85)
at com.sun.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:201)
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98)
at org.primefaces.util.ComponentUtils.getConverter(ComponentUtils.java:152)
Truncated. see log file for complete stacktrace
Environment:
WLS 12.2.1.3.0
Java EE 7
ejb-project & web-project -> ear-project -> parent project
parent project pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xxx.yyy</groupId>
<artifactId>bsp</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>bsp</name>
<properties>
<application.name>bsp</application.name>
<application.ear.name>bsp-ear</application.ear.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>bsp-ear</module>
<module>bsp-web</module>
<module>bsp-ejb</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.3.7.Final</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.2</version>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>6.2.10</version>
</dependency>
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>wls-api</artifactId>
<version>12.2.1-0-0</version>
</dependency>
</dependencies>
ear project pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bsp</artifactId>
<groupId>xxx.yyy</groupId>
<version>1.0</version>
</parent>
<artifactId>bsp-ear</artifactId>
<packaging>ear</packaging>
<name>bsp-ear</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<webModule>
<groupId>xxx.yyy</groupId>
<artifactId>bsp-web</artifactId>
<contextRoot>/bsp</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>xxx.yyy</groupId>
<artifactId>bsp-ejb</artifactId>
<version>1.0</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>xxx.yyy</groupId>
<artifactId>bsp-web</artifactId>
<version>1.0</version>
<type>war</type>
</dependency>
</dependencies>
ejb project pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bsp</artifactId>
<groupId>xxx.yyy</groupId>
<version>1.0</version>
</parent>
<artifactId>bsp-ejb</artifactId>
<packaging>ejb</packaging>
<name>bsp-ejb</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.1</ejbVersion>
</configuration>
</plugin>
</plugins>
</build>
web project pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bsp</artifactId>
<groupId>xxx.yyy</groupId>
<version>1.0</version>
</parent>
<artifactId>bsp-web</artifactId>
<packaging>war</packaging>
<name>bsp-web</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>xxx.yyy</groupId>
<artifactId>bsp-ejb</artifactId>
<version>1.0</version>
<type>ejb</type>
<scope>provided</scope>
</dependency>
</dependencies>
xhtml:
<?xml version="1.0" encoding="utf-8"?>
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<f:view contentType="text/html">
<h:head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="author"
content="ABC" />
<meta http-equiv="Cache-Control"
content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="expires" content="0" />
<title><ui:insert name="title">#{app['name']}</ui:insert></title>
<link type="text/css" rel="stylesheet"
href="#{facesContext.externalContext.requestContextPath}/layout/css/custom.css" />
</h:head>
<h:body>
<p:growl id="messages" sticky="true" showSummary="true" showDetail="true"/>
<h:panelGrid id="headerTopPanel" styleClass="zColumnTopAlign">
<h:panelGrid id="headlinePanel" columns="3"
columnClasses="zHeaderLinks, zHeaderMitte, zHeaderRechts">
<logo>bsp</logo>
<h:panelGrid id="topMenuPanel">
<ui:insert name="topMenu" />
</h:panelGrid>
<h:panelGrid id="iconMenuPanel">
<ui:insert name="iconMenu" />
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
<h:panelGrid id="headerBottomPanel">
<h:panelGrid id="breadcrumbPanel" columns="2"
columnClasses="zLeft, zRight">
<h:panelGrid>
<ui:insert name="breadcrumb" />
</h:panelGrid>
<h:panelGrid>
<p:ajaxStatus styleClass="zAjaxStatus">
<f:facet name="start">
<p:commandLink styleClass="iconLoading" />
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
<p:separator id="menuSeparator" />
<h:panelGrid id="middlePanel" styleClass="zColumnTopAlign">
<!-- <h:panelGrid id="messagesPanel">
<p:messages id="messages" showIcon="false"/>
</h:panelGrid> -->
<h:panelGrid id="sideMenuContentPanel" columns="2"
columnClasses="z12percentBreit zLeft, z88percentBreit zLeft zOverflowAuto">
<h:panelGrid id="sideMenuPanel">
<ui:insert name="sideMenu" />
</h:panelGrid>
<h:panelGrid id="contentPanel">
<ui:insert name="content" />
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
</h:body>
</f:view>
</html>
Controller:
package xxx.yyy.controller;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import xxx.yyy.util.MessageHelper;
import xxx.yyy.util.PropertiesUtil;
#Named
#RequestScoped
public class LogInOutController {
#Inject
private PropertiesUtil propertiesUtil;
private String username;
private String password;
private String test = "test";
public String login() {
if (username.equals("bsp") && password.equals("bsp")) {
MessageHelper.showInfoMessage(propertiesUtil.getAppProperty("halloTest"), this);
}
return null;
}
public String logout() {
return null;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getTest() {
return test;
}
public void setTest(String test) {
this.test = test;
}
}
If that is not enough or more is needed, please let me know.
I would be overjoyed if someone could help me.
Thanks in advance
I finally found the reason it didn't work.
I had to change the publishing mode of the WebLogic Server:
Right Click on Server -> Properties -> WebLogic -> Publishing -> Publish as an exploded archive