JSP Global Variable in MultiUser Environment???
Hi,
I heard that my Boss, taking about the declaration of the Global variable in Jsp will create a problem in the Multi-User Environment.
Is it true?? If so ,What is the actual problem? It occupies more memory when compared to the Local variable??
Isn't it a bad option to declare unless u want it badly??
I am not able to find a suitable link for this..
Pls. do respond for this....
Thanks,
JavaCrazyLover
Its bad because global variabels will be used and changed by different users at same time.
This will lead to variuos problem like user1 setting the variabel, user2 seting it , user1 using it with the value user2 set.
Similar Messages
-
Reading a global variable from tomcat with JNDI. Example not working
Hi you can help me to make this example work?
Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup("java:comp/env");
Object o = envCtx.lookup("testvariable");
<GlobalNamingResources>
<Environment name="testvariable" type="java.lang.Boolean" value="false"/>
Nice greetings ChristianI found out that in addition to having the JNDI lookup code, you have to
- have the environment variable declared in the app server configuration
- have a resource-env-ref entry in your webapp module
- have the application container bind your named variable with the global variable
I am using tomcat 5.5, and have done the following. with success.
the following example uses the default sample environment variable in the tomcat server.xml
in tomcat server.xml:
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
</GlobalNamingResources>
in my application's web.xml:
<resource-env-ref>
<description>Test read resource environment variable</description>
<resource-env-ref-name>simpleValue</resource-env-ref-name>
<resource-env-ref-type>java.lang.Integer</resource-env-ref-type>
</resource-env-ref>
in my META-INF/context.xml (or otherwise, in tomcat's context deployment configuration)
<ResourceLink name="simpleValue" global="simpleValue"
type="java.lang.Integer"/>
Note: in theory, the named resource by your web app could be different from the global environment variable, but here they are the same 'simpleValue'
This is the really important step, that with out it, nothing works.,
the context.xml is known to work with tomcat when it exists in META-INF/context.xml inside the .war file (i use war files to deploy, but you should be able to create META-INF/context in an unpacked webapp directory too, and tomcat will find it.,
I can not say what it is like for other app servers, but this mapping step is the critical point that i discovered after A LOT of hair pulling.
then, make use of it, i created a jndiTest.jsp:
<%@ page import="javax.naming.Context" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="javax.naming.NamingException" %>
<%
try {
Context initCtx = new InitialContext();
Context ctx = (Context) initCtx.lookup("java:/comp/env");
Object o = ctx.lookup("simpleValue");
%>
<%=o%><br>
<%
catch (NamingException ex) {
System.err.println(ex);
%>
since my server.xml defines the value for 'simpleValue' to be 30, this page displays 30 -
hi, i am using jdeveloper version 11.1.1.1.0.
i try to get value of field "id" from a table "customer" from input value from "username" and "password" form in welcome / login page.
the value of field "id" that logged on will be used for further operation like determine relationship with other table for showing data.
to accomplish that, i create a new java class "bean.java"
the content is simple, just a few variable like : eeid,eeuser,eepass, and more else.
each variable have accessors.
after create "bean.java", i register that class to faces-config.xml in managed beans tab. i give it description like below :
- name : beanku
- class : mvc.bean
- scope : session
to login, i check the login button with code like this :
public String cmdSigninee_action() throws ClassNotFoundException, SQLException {
String tuser = (String) inputUseree.getValue(); --> value of username
String tpass = (String) inputPassee.getValue(); --? value of password
bean ong = (bean) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("beanku"); --> it's ok here
ong.setSeeid("testing"); --> here is the error
i got an error message like shown below :
Target URL -- http://127.0.0.1:7101/madf-mvc-context-root/faces/welcome.jsp
Dec 4, 2009 11:39:26 PM oracle.jbo.uicli.mom.CpxUtils$Visitor logMainApplicationCpx
INFO: file:/C:/Documents and Settings/Ong/Application Data/JDeveloper/system11.1.1.1.33.54.07/o.j2ee/drs/madf/madf-mvc-webapp/WEB-INF/classes/mvc/DataBindings.cpx
Dec 4, 2009 11:39:27 PM oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImpl setLifecycleContextBuilder
INFO: ADFc: Initializing ADF Page Lifecycle for the JSF environment, LifecycleContextBuilder is 'oracle.adfinternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
Dec 4, 2009 11:40:21 PM com.sun.faces.application.ActionListenerImpl processAction
SEVERE: java.lang.NullPointerException
javax.faces.el.EvaluationException: java.lang.NullPointerException
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.lang.NullPointerException
at mvc.backing.Welcome.cmdSigninee_action(Welcome.java:380)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
... 38 more
Dec 4, 2009 11:40:21 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
WARNING: #{backing_welcome.cmdSigninee_action}: java.lang.NullPointerException
javax.faces.FacesException: #{backing_welcome.cmdSigninee_action}: java.lang.NullPointerException
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
... 37 more
Caused by: java.lang.NullPointerException
at mvc.backing.Welcome.cmdSigninee_action(Welcome.java:380)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
... 38 more
Dec 4, 2009 11:40:21 PM com.sun.faces.lifecycle.Phase doPhase
SEVERE: JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /welcome.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@8aa35b]
<Dec 4, 2009 11:40:21 PM ICT> <Error> <HTTP> <BEA-101017> <[ServletContext@14855001[app:madf module:madf-mvc-context-root path:/madf-mvc-context-root spec-version:2.5], request: weblogic.servlet.internal.ServletRequestImpl@5a2f7[
POST /madf-mvc-context-root/faces/welcome.jsp?_adf.ctrl-state=4p5g40az1_4 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://127.0.0.1:7101/madf-mvc-context-root/faces/welcome.jsp;jsessionid=vs4JLZ7ppccm9mdq4z1RJn31c1Qj9ZpLmdHhT2BGTThzP7JnZfmJ!1909271282?_adf.ctrl-state=4p5g40az1_4
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
Content-Length: 346
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=vs4JLZ7ppccm9mdq4z1RJn31c1Qj9ZpLmdHhT2BGTThzP7JnZfmJ!1909271282
]] Root cause of ServletException.
javax.faces.FacesException: #{backing_welcome.cmdSigninee_action}: java.lang.NullPointerException
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
Truncated. see log file for complete stacktrace
javax.faces.el.EvaluationException: java.lang.NullPointerException
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
Truncated. see log file for complete stacktrace
java.lang.NullPointerException
at mvc.backing.Welcome.cmdSigninee_action(Welcome.java:380)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
Truncated. see log file for complete stacktrace
>
anyone can help me with those errors? i just need global variable, so i can use it for check relationship with other table.
or if anyone of you can give me another way to get the value of field "id" from a table?
thank you so much before! and i am sorry if my english is bad.If you select the JSP page in the graphical stuts-config.xml overview in JDeveloper, you should see the properties of the JSP page in the property inspector. One of those properties defines the Java class that handles the action/forwarding/etc.
Then you should create a new Java-class that extends the original action handling class. Change the property in the graphical stuts-config.xml overview in JDeveloper to this new class.
Then add an event attribute to the submitbutton element in the form of your JSP page, e.g. seeDetails.
In your newly created class you can then create a new method: onSeeDetails. This method should be invoked when the submit button is pressed and the form is submitted.
In the ADF ToyStore demo there are some examples of Java classes that extend the standard action handler. There in the ViewController project.
ROnald -
How to Set and Use a global variable within a session?
Dear All,
I'm new to jsp, and would like to ask how to set and use a global variable within a session?
Thanks in advance.
Regards,
CecilWith session.setAttribute("name",object) you can store a Attribute in the session object.
with session.getAttribute("name") you can get it.
That's it.
Regards,
Geri -
Re: Global Variables (what! More?!?)
[email protected] writes:
One problem with using service objects for global variables is
the flat namespace they expose.I thought that was the definition of a global variable.
I could find no sanctioned way to provide a NameSpace that was
global only for a Server Partition. By "global only to a server partition" do you mean "visible only
to a server partition, but not to any others or to the clients?"
If so, how 'bout putting them in a user-visible service object?
Remember, "user-visible" is Forte's mis-terminology for
"partition-visible." No law that I'm aware of says you can't put
a user-visible service object in a server partition.
<Snip! rest of letter, which in brief described a "roll-your-own"
partition global area built into a subclass of TextNullable and (here's
the really neat part!) replacing task.part.AppTitle with this object.>
I have nothing to say about your workaround, except that it's a
REALLY ugly hack (yes, I've been around for a while, too), and I
wish I had thought of it! One can imagine ALL SORTS of creative
things to do with this concept.
Tom WyantDavid Krieger/CORP/PART/CSC
04/14/97 05:27 PM
do you mean "visible only
to a server partition, but not to any others or to the clients?"
Yes, that is a better way to say it.
If so, how 'bout putting them in a user-visible service object?
Remember, "user-visible" is Forte's mis-terminology for
"partition-visible." No law that I'm aware of says you can't put
a user-visible service object in a server partition.
Unfortunately all Forte Service Objects share a single name space. I
thought from the documentation that User Visible Service Objects would work
for me. However, when I tried User Visible Service Objects, they didn't
quite do the trick because what I wanted was identically named service
objects that resolve to a different local instance for each partition. So
no matter where my code was running, it could call ProcessLocalStore.Foo()
and it would get the ProcessLocalStore for that partition. Note that I am
not talking about replicated partitions. Even though they are called
"user-visible service objects, there can only be one instance of the named
service object in any given Forte environment. -
Is there any easy way to copy a group of global variable from one job to another? I know I can insert the global variables one at a time but there must be a quicker way????
Hi Richard,
You might be interested in a new feature in the 12.0 release of Data Integrator (it's built on the Data Services XI 3.0 platform). The feature is called "substitution variables", and allows you to have a single set of variables for a runtime environment. They are static in nature (meaning you cannot change their value after you launch a job) but you can have different configurations of variable assignments. You control all of this using system configurations -- it's a lot like using datastore configurations with system configurations today, except that you can define sets of substitution variable values to go along with a specific system configuration.
You may want to talk to your account manager about migrating your license to an XI 3.0 license. Also, the first service pack for 12.x will be released soon (Septemberish?), which is a good indication that the tool is ready for serious production usage.
Thanks,
~Scott -
Why do global variables have a .vi extension?
Hi,
While cleaning up some code the other day, it occured to me that although Virtual Instruments and Global Variables are distinct entities with separate roles in the LabVIEW environment, they share the same file extension .vi. It seems much more logical to assign a unique extension like we already do for controls, menus, classes, etc.
Can anyone explain why it's done this way?
Thanks!
Solved!
Go to Solution.No terminals on a global's BD. Just a blank slate. You CAN put stuff there but if there is any reference to a FP object LabVIEW will blow up on you so there is no real easy way to pass data in or out. (I once thought of embeding a counter into a global- It was not pretty)
Regardless, no matter what you COULD do, there must be another legitamate way to do the same thing. Its basically "Trickery or witchery." Do that kind of thing at your own risk! (Don't try this at home- We are professionals) Since you shouldn't be there, there are fewer protections. BAD things CAN and likely WILL happen. Think of it like triing to drive a car on two wheels. Its possible but, perhaps you want to try it with a really cheap car and know someone good with body repair.
Jeff -
hi
im using labview 6.1.
i have a frame in a sub-vi that that reads 16 bytes from com7 (in my pc) into a global variable using a custom DLL. this variable is then used later to compare some data in another sub-vi.
this was working fine for a day, then this morning i started it again and ran it. when i got to the point where this "read" happens i got a dr watson exception message. (i am running the application on nt4 in the development environment). after this point the gloabal had rubbish in it whenever i did a read, although it did also hold the basic read data. after a reboot etc it still did it. the fix was to completely remove this global from the application vi and my file globals.vi , create a new one and then use that in the same manner.
everything was ok for an hour.
then the same thing happened again.
any ideas? this is really annoying.It sounds like you're DLL is corrupting LabVIEW's memory. This doesn't necessarily mean you're DLL is doing anything wrong. It just means you have to be careful when calling external code in LabVIEW to make sure that it plays nice and doesn't stomp on LabVIEW's internal memory.
If you expect your DLL to output a 16-character buffer on every call, then you should be passing in a dummy string into the buffer input for your Call Library Function Node of at least 16 characters in length. This will help LabVIEW allocate the data correctly and pass it into the DLL to operate on. The DLL should not resize this buffer, because LabVIEW won't be notified.
Are you doing anything along these lines?
Message Edited by Jarrod S. on 03-01-2007 03:06 PM
Jarrod S.
National Instruments
Attachments:
allocate_string_dll.PNG 18 KB -
Where to store "global variable" for a web application
There are some "global" variables in my portal web application. e.g. email server
name, admin email address etc. Will web.xml context-param a good place to store these
kind of information?
If so, how do I retrieve it back from a java class? It is easy in a jsp file: appalication.getAttribute(),
but how about a pipeline component or input processor which are all java file.
Please help!
Thank you very much
EllenI still believe that the information like connectivity parameters to remote
servers in the distributed environments would be best stored in the JNDI
tree. I agree, that it is not a "general storage area", but I am not talking
about storing application run-time data either.
In the clustered environments it would provide additional benefits of
centralizing this kind information across the cluster.
Regards,
Mike
"Subrahmanyam Allamaraju" <[email protected]> wrote in message
news:[email protected]..
>
JNDI is not a general-purpose storage area, although you could bind data
in a JNDI tree. A better (and simpler) way is to store them as context
parameters. You could read the initial values for these variables from a
servlet init parameters.
Subbu
Michael Goldverg wrote:
Ellen,
I would advise to put you global variable in JNDI tree.
You can use jndi.properties file to store name-value pairs, which will
get
loaded into jndi tree at the server startup. Just put this file in your
application class path.
The other method would be to code a startup class to store the global
variable in the jndi tree.
Regards,
Mike
"ellen" <[email protected]> wrote in message
news:[email protected]..
There are some "global" variables in my portal web application. e.g.
email
>>
server
name, admin email address etc. Will web.xml context-param a good place
to
>>
store these
kind of information?
If so, how do I retrieve it back from a java class? It is easy in a jspfile: appalication.getAttribute(),
but how about a pipeline component or input processor which are all javafile.
Please help!
Thank you very much
Ellen -
Global Variables passing from standard form for use on custom form
Hi,
I'm trying to grab a value from a standard form, and pass it to a new custom form, which I am opening automatically from the standard form via personalizations. Is anyone aware of a way to send a value from one form to another? I was going to try using a global variable, which it looks like you can set through personalization. I tried doing it by passing the value as a form parameter, which works if I hard code a value, but it doesn't work if I refer to a value from the standard form.in your E-Business-environment may exist some special codings, which you have to think of, when passing parameters through the application.
Copy the question to your EBS-Forum. They know ways using personalization and passing parameters -
Application Builder - Use of Global Variables
Hello,
I have an application which consists one one main VI running for the user interface, and one VI running in the background dealing with CAN communications. These two VIs must communicate using global variables. In the main VI, I have to open a reference to the global variable VI in order to write data to it. The application works correctly in LabVIEW environment. However when I build the application using application builder, I receive an error with the open reference VI in opening the global variable VI. The error given is Error Code 7: File not found. The path to the Global variable VI is correct however. I am pretty sure of this because in my main VI, I open up other VIs based on the open reference function and a path.
Therefore:
1) I can open references to normal VIs and use properties such as run VI without a problem.
2) This does not work for my global variable vi.
Build settings:
Im dont understand all the build options completely but the settings I use are:
1) Single target file contening all the VIs
2) All the VIs I use are located in the same folder
I hope the explaination is clear enough.
Do you have any suggestion to explain what happens and how can I make it work correctly?
Thanks
JulienDuplicate.
Try to take over the world! -
Applicatio​n Builder - Use of Global Variables
Hello,
I have an application which consists one one main VI running for the user interface, and one VI running in the background dealing with CAN communications. These two VIs must communicate using global variables. In the main VI, I have to open a reference to the global variable VI in order to write data to it. The application works correctly in LabVIEW environment. However when I build the application using application builder, I receive an error with the open reference VI in opening the global variable VI. The error given is Error Code 7: File not found. The path to the Global variable VI is correct however. I am pretty sure of this because in my main VI, I open up other VIs based on the open reference function and a path.
Therefore:
1) I can open references to normal VIs and use properties such as run VI without a problem.
2) This does not work for my global variable vi.
Build settings:
Im dont understand all the build options completely but the settings I use are:
1) Single target file contening all the VIs
2) All the VIs I use are located in the same folder
I hope the explaination is clear enough.
Do you have any suggestion to explain what happens and how can I make it work correctly?
Thanks
JulienYour usage sounds very weird. Normally, the best reason to use a standard global is that it's easy to use. You simply place it in the diagram and select the one you want. Your use case of opening a reference to the VI sounds weird.
You say that the path is correct. There is a very simple way to check this. Place a path indicator showing the path you built and you will see exactly. The most common reason for path problems in executables is if you build relative paths since the executable itself is treated as another directory, so you have an extra level. The common way to go around this is to use the Application.Kind property and if you're running in the RTE perform an extra strip. Another problem you might have is that if you are dynamically loading the VI, it will not get included in the build automatically. You have to include it manually either by selecting it as a support file or by including a VI which calls it normally.
After all that, though, my suggestion would simply be to avoid the global. If you need inter-VI communication you can use a lot of other global options like LV2 globals, named queues, notifiers, etc. or even use globals as they were intended and they will all probably be simpler than the way you currently use globals. Note that global communication in LabVIEW is very risky because you can easily create race conditions and it's important to look out for that.
Try to take over the world! -
I need to create a way for someone to view my LV 6.1 application from another computer. I know there are ways to do this; but I also need for the remote computer to be able to change tab controls to view different sets of data without changing what the local operator is seeing. (I.e. a VNC solution will not work)
I was thinking that the easiest way to do this might be to just make a duplicate of the program and disable all of the controls I don't want them to be able to use, then just use global variables to pass the live data from the main program to the remote program. Since the remote program will not be able to change the state of any of the globals, there won't be any possibility of race conditions between the two programs. This way I can just pass the status of all of the indicators on the screen to the other program.
Will this actually work? The two programs will both have to be built into exe files; and will need to be able to run on a PC that only has the run-time environment installed.
Thanks for your helpI was originally thinking of using TCP/IP to impliment this functionality, but it seems like it would be simpler to have the main program publish all of its indicators that I want visible to datasocket, then in my remote program have it subcribe to those datasocket items on the main computer. Is this going to cause a major VI slowdown on my main PC I was just going to use the front panel datasocket functionality (i.e. right click and data operations -> datasocket connection)? There are probably 30+ indicators and some charts/graphs that I want to share between the programs.
-
Global variables to share data between separate programs.
Hi guys and gals,
On the advice of a lv consultant, we've used an array of global
variables to share data (about 100 variables) between an acquisition/control
program and a consumer program (datalogging) running on the same PC. This
worked fine in the development environment. However it no longer works when
the two programs are compiled. Is there a trick to get this to work or do
we have to use datasockets or DDE to move the data.
In case you're wondering the idea of two separate programs is to
separate the critical control and data acquisition functions from the less
critical but more likely to error datalogging functions.
Regards,
Alf Katz,
[email protected]There are several solutions:
1.) Use VI Server available in LabVIEW 5.1 and Up to provide a communication
path between the two executables.
2.) Use a data file to transfer the data between the two executables.
3.) Use a TCP/IP connection there are several examples included with LabVIEW
showing the mechanics of this.
The simplest method is Number 1. Using the VI server, you open the
connection and then retrieve the data form the Global VI based on the
Parameter Name. It is very fast and requires very little processor
overhead. Make a driver to Open the connection then a Read to get the data.
Do not open and close the connection everytime, there is a lot of overhead
in the Open connection call.
Make sure you configure the VI Server within the development environmen
t.
Also you must include a few statements in the Executables INI file to
correctly enable the VI server capabilities.
Regards,
Jeff Meyer
Consultant
Focused Energy
Suffield, CT USA
"Alf Katz" wrote in message
news:[email protected]..
> Hi guys and gals,
> On the advice of a lv consultant, we've used an array of global
> variables to share data (about 100 variables) between an
acquisition/control
> program and a consumer program (datalogging) running on the same PC. This
> worked fine in the development environment. However it no longer works
when
> the two programs are compiled. Is there a trick to get this to work or do
> we have to use datasockets or DDE to move the data.
>
> In case you're wondering the idea of two separate programs is to
> separate the critical control and data acquisition functions from the less
> critical but more likely to error datalogging functions.
>
>
> --
> Regards,
> Alf Katz,
> [email protected]
org
>
>
> -
About Document IDS in multiuser environment
I am developing an online application using oracle 8.0.5 , it is a multiuser environment , what is the best method to code about generating the number of documents from multiple places , how we can lock the number (document number e.g. Purchase Order) generated for one to another , please tell advice me the best & feasible approach to handle the tie of a mnumber from different sites and handeling of cancelation of any generated number from one person and alloting it to other users
thanksIts bad because global variabels will be used and changed by different users at same time.
This will lead to variuos problem like user1 setting the variabel, user2 seting it , user1 using it with the value user2 set.
Maybe you are looking for
-
Urgent Help needed in Objects & VARRAY
Hi all, This is my first time doing query involving varray and objects. I have create tables, varray and object with below scenario :- CREATE TABLE Analogue (UniqueName varchar2(20) not null, DefaultRole T_ROLE, AlarmRoles T_ROLEARRAY); CREATE TYPE T
-
Automatic Payment Program-problems with check printing/viewing
Hello: I am new to the SAP field. I have been trying to make the automatic payment program work for me. I have been having trouble trying to view the print preview of checks by going to system->own spool requests. Steps followed ---Automatic Payment
-
Can I switch to another Coherence Grid in Java Extend?
The scenario is I have two data grids, the name of the cache are same, but data in the cache is different. I programmed a Java Client (Extend) to the data grid, the Java client is using a configuration file configured to connect with one of the data
-
I have changed from pc to mac and photoshop elements 2.0 disk does not install on mac
I have changed from pc to mac and photoshop elements 2.0 disk does not install on mac
-
I am trying to install Apss 11i Rel 2 on RH 6.1. The installer doesn't copy all the data and Index files. Hence the install fails. Please help 111