Next page after login

Post Reply
francescoL
Posts: 8
Joined: 15 Mar 2019, 19:02

27 Dec 2019, 19:52

Hi, next page after login has a band at the top (like that of the login)

This is my xhtml:

<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
</f:facet>
<link rel="shortcut icon" type="image/png" href="#{request.contextPath}/resources/images/motos.png"/>
<title>Motus - Consegne Auto</title>

<h:outputScript name="js/nanoscroller.js" library="omega-layout" />
<h:outputScript name="js/layout.js" library="omega-layout" />

<ui:insert name="head"/>
</h:head>

<h:body styleClass="main-body #{guestPreferences.menuLayout}">
<h:form id="consegne">
<p:growl id="msg" showDetail="true" life="3690"/>

<p:menubar>
<ui:insert>
<ui:include src="submenu_navigazione" />
</ui:insert>

....

these are last lines:

<h:outputStylesheet name="css/animate.css" library="omega-layout" />
<h:outputStylesheet name="css/nanoscroller.css" library="omega-layout" />
<h:outputStylesheet name="css/layout.css" library="omega-layout" />
</h:body>

aragorn
Posts: 3978
Joined: 29 Jun 2013, 12:38

31 Dec 2019, 15:06

Hi,

Unfortunately, I don't understand this issue. Could you please give me more details?

Best Regards,

francescoL
Posts: 8
Joined: 15 Mar 2019, 19:02

01 Jan 2020, 10:14

first of all happy new year !!!

This is first page login:
https://www.dropbox.com/s/2qg2po8qz61fq ... n.png?dl=0

This is second page after login (and has border on the top: does not start from top!!!):
https://www.dropbox.com/s/qd1isyp8aa9xx ... r.png?dl=0

If I press reload button it's ok (img3):
https://www.dropbox.com/s/mq9gccsdp2x1j ... r.png?dl=0

Thanks again and I hope it is more understandable.
Again good 2020 !!!

aragorn
Posts: 3978
Joined: 29 Jun 2013, 12:38

02 Jan 2020, 08:26

Hi,

Happy new year !!!!

Thanks a lot for the screenshots. Could you please attach your template xhtml page? Also, there is "login-body" class in body tag after redirecting to another page. Could you please check it in the browser's inspector? And how do you navigate with the login button to a page after login? Forward or Redirect Navigation?

Best Regards,

francescoL
Posts: 8
Joined: 15 Mar 2019, 19:02

02 Jan 2020, 09:04

This is login.xhtml:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">

<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
</f:facet>
<link rel="shortcut icon" type="image/png" href="#{request.contextPath}/resources/images/motos.png"/>
<title>Motus</title>
</h:head>

<h:body styleClass="login-body">
<h:form id="loginForm">
<p:growl id="msg" showDetail="true" life="3690"/>

<div id="login-wrapper">
<p:graphicImage name="images/login-logo.png" library="omega-layout"/>

<div id="login-container">
<p:focus context="loginForm"></p:focus>
<span class="title">Motus - Login</span>

<div class="ui-g ui-fluid">
<div class="ui-g-12">
<p:inputText placeholder="Utente" value="#{login.login}" required="true"
requiredMessage="Utente è obbligatorio!!!"/>
</div>
<div class="ui-g-12">
<p:password placeholder="Password" feedback="false" value="#{login.password}" required="true"
requiredMessage="Password è obbligatoria"/>
</div>
<div class="ui-g-12">
</div>
<div class="ui-g-12">
</div>
<div class="ui-g-12">
<p:commandButton id="loginButton" action="#{login.validateUsernamePassword}" value="Login" icon="fa fa-check"
update="loginForm" ajax="true"/>
</div>
</div>
</div>
<p:graphicImage name="images/tomasi.png" library="omega-layout"/>
<div class="login-footer">(c) Copyright 2019 - Infinite Soft - www.infinitesoft.eu</div>
</div>
<!-- <p:blockUI block="loginForm" trigger="loginButton" style="float:right;">-->
<!-- <p:graphicImage name="images/preloader.gif" library="omega-layout" style="width: 32px;"/>-->
<!-- </p:blockUI>-->
<p:ajaxStatus style="width:220px;height:23px;position:fixed;right:7px;bottom:7px">
<f:facet name="start">
<p:graphicImage name="images/loading11.gif" library="omega-layout" style="width: 220px;"/>
</f:facet>

<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
</h:form>
<h:outputStylesheet name="css/layout.css" library="omega-layout" />
</h:body>

</html>

I do not understand Forward or Redirect Navigation?!
I address the user to the page via a method. Example validateLogin:

//validate login
public String validateUsernamePassword() {
boolean valid = LoginDB.validate(login, password);

if (valid) {
Utenti utenti = (Utenti) SessionUtils.getAttribute(SessionUtils.ATT_UTENTE);
if (DBCommunication.getString(utenti.getHomePage()).equals(""))
return Utenti.PAGE_CONSEGNE;
else
return utenti.getHomePage();
} else {
Global.showMessageWarning("Errore Login", "Prego inserire Utente e Password corretti");
return "login";
}
}

Thanks!!!

francescoL
Posts: 8
Joined: 15 Mar 2019, 19:02

09 Jan 2020, 13:04

Can you please help me out? Have I been unclear?

Best regards
Francesco

aragorn
Posts: 3978
Joined: 29 Jun 2013, 12:38

09 Jan 2020, 14:11

Please review;
https://www.mkyong.com/jsf2/jsf-page-fo ... -redirect/

You need to use Redirect Navigation. Please add ?faces-redirect=true to your url or use <redirect />.

Best Regards,

francescoL
Posts: 8
Joined: 15 Mar 2019, 19:02

09 Jan 2020, 18:04

thanks a lot: everything works !!!

aragorn
Posts: 3978
Joined: 29 Jun 2013, 12:38

14 Jan 2020, 08:45

Glad to hear, thanks a lot for the update!

Best Regards,

Post Reply

Return to “Omega - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest