Questions tagged [facescontext]

This tag denotes the FacesContext class which is part of the Java Server Faces (JSF) model view presenter framework. It is used to permit disambiguation with the deprecated generic [context] tag.

This tag denotes the FacesContext class which is part of the Java Server Faces (JSF) model view presenter framework. It is used to permit disambiguation with the deprecated generic tag.

See Also

See the main information on .

112 questions
0
votes
1 answer

Which is the better way to access pageflowscope variable in ADF

As we know there are multiple ways to access the page flow scope variable but which one is the right one? ex RequestContext.getCurrentInstance().getPageFlowScope(); AdfContext.getCurrent.getPageFlowScope(); FacesContext? I am also curios to know…
gavityBox
  • 1
  • 2
0
votes
0 answers

uploading file on the server by clicking on generateFile and return a link to download jsf

Jsf : how can i upload file to the server without having upload button .?? i have a genarate Excel File button. how can i upload it to the server just by clikcing the Excel file Button and return a link to download file from the server ?? public…
0
votes
1 answer

Primefaces: pagination elements in FacesContext

I need help. If someone can help I would be grateful. I have a Datatable with pagination and I want to have Pagination data from paginatorTemplate (RowsPerPageDropdown and CurrentPageReport) outside the Datatable (in Managed Bean), how I can get…
kenanze
  • 1
  • 1
0
votes
1 answer

Trying to set and get attribute from one class to another via a 3rd class in JAVA

I have a bean class which looks like this @ManagedBean(name = "usingBean") @SessionScoped public class UserInfo implements Serializable { private static final long serialVersionUID = 2668727340500045081L; String loginId; } I set this…
CSD
  • 11
  • 1
0
votes
0 answers

How can I captured an exception and show its in context message?

I have a exception on Usuario usuario = gestionUsuario.hacerLogin(nombre, clave); and I want capture the exception and show its in a context message. I implemented the next code, but the application show an alert message: serverError: class…
Juan C
  • 29
  • 3
0
votes
0 answers

FacesContext return wrong value

in login method i stored the connected user in FaceContex to use it in others managedbeans the problem that when i run this method: User connectedUser = (User)…
amine
  • 1
  • 2
0
votes
1 answer

Get context-param in asynchronous method seam

I want to get a context-param configure in my web.xml. In a method call normally (with seam 2.2.0), I do this: readDirectory = (String) FacesContext.getCurrentInstance() .getExternalContext().getInitParameter( …
Kiva
  • 9,193
  • 17
  • 62
  • 94
0
votes
2 answers

FacesContext.addMessage() does not show message in p:messages

i have a managed bean with a method that add a message like this: @ManagedBean @ViewScoped public class FileMB implements Serializable{ private static final long serialVersionUID = -2843716026642626725L; private UploadedFile file; private boolean…
0
votes
1 answer

JSFUnit accessing FacesContext before JSFSession is created

I want to access the JSFUnit FacesContext before I create the JSFSession object. The reason for this is I would like to set a managed bean value before any request/response processing is done. I use this value in a filter.
Panayiotis Karabassis
  • 2,278
  • 3
  • 25
  • 40
0
votes
1 answer

FacesContext.getCurrentInstance returns null in PrimeFaces Dialog Framework demo

I want to run the ShowCase demo of Dialog Framework - Data on GlassFish 4.1 and NetBeans 8.0.2. I Copy/Paste code from showcase. But I encountered a NullPointerException on this line: FacesContext.getCurrentInstance().addMessage(null,…
0
votes
4 answers

How to set a user defined language in Xpages

In my xpage I need to set a user defined language before the page loads. the language to be set is stored in a document in the database so I do this in beforePageLoad var lang =…
Thomas Adrian
  • 3,543
  • 6
  • 32
  • 62
0
votes
0 answers

Missing FacesContext inside @WebServlet #doGet(...)

I have some bean using the @WebServlet annotation: @WebServlet("tools/httpProjectLoader.xhtml") public class HttpProjectLoader extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response)…
Daniel Bleisteiner
  • 3,190
  • 1
  • 33
  • 47
0
votes
1 answer

Access FacesContext in xAgent (in new Thread)

I am planning to use single entry point for all 5 minutes xAgents, meaning one XPage launchs all 5 minutes "java agents" (classes that should be launched every 5 minutes). I would like to lauch that java code in new different Threads to have true…
AndrewG10i
  • 661
  • 1
  • 6
  • 21
0
votes
1 answer

CDI injection - NPE of FacesContext when using Deltaspike @scheduled

I'm using a Deltaspike (1.4.0) with Quartz (2.2.1) to schedule a job. In the TestJob bean is injected ResourceBundle. The producer of ResourceBundle needs a facesContext, but this always is null. How can inject properly ResourceBundle in the…
0
votes
2 answers

What is the easiest way to get an LDAPContext from a FacesContext?

I've got a Java doLogin() method invoked from a JSF page that gets an id (String netId) and password (String password) from the user. doLogin() initiates the authentication using netId as the principal in an Active Directory login. After that, I…
PMorganCA
  • 730
  • 6
  • 24