Scope/Class referencess

Ok... I have been converting my application with static variables to instance(?) variables and I'm running into issues. I really hope someone can help.
I had static variables with one thought in mind, but do to the fact that it causes problems with the multiuser arena, I was changing them back...
I have: 1) a login.jsp that stores the login information of a person; 2) main.jsp that contains calls to 3 different classes; 3) loginInfo class that holds login info; 4) SCR_Info class that contains some business logic for the app; 5) StrReqEntImpl that is the meat of the business logic for the Entity (Database connectivity)...
main.jsp
<jsp:useBean id="login" class="com.vs.lmco.ASD.connection.loginInfo" scope="session" />
<jsp:useBean id="scr" class="com.vs.lmco.application.SCR.SCR_Info" scope="session" />
<jsp:useBean id="scrView" class="com.vs.lmco.application.SCR.StrReqEntImpl" scope="session" />
scr.setLogin(login);
scrView.setSCR_Info(scr);
Inside of the doDML of , I have StrReqEntImpl:
setRequestorId(new Number(scr.getPaxId()));
Ok, I put a println statement when the scrView.setSCR_Info(scr) is called. It prints com.vs.lmco.application.SCR.SCR_Info@81, like it should. Then I make a modification to the record via JSP and try to commit it. I did another println which displays a null value. The class instance of the SCR_Info is lost when I try for the commit.
Can anyone help with my logic and how I can solve the problem?
Thanks in advance,
Jim

I think that I may have found a solution... There might be a better way, and maybe this will be able to get someone else thinking about something related...
Ok, I have my jar file which contains now loginInfo & a new staticLoginInfo. My loginInfo contains all of the instance variables; whereas the staticLoginInfo contains static references to the instance class.
ASD.jar - staticLoginInfo.java:
private static Vector reference = new Vector();
public static int setUp(loginInfo login)
int seq = reference.size();
reference.add(seq,login);
return (seq)
public static loginInfo getLogin(String seq)
return ((loginInfo)(reference.get(Integer.parseInt(seq))));
Now I have a war file that contains contents.jsp which contains links to the different applications that the logged in user has access to.
ASD.war - contents.jsp:
seq = staticLoginInfo.setUp(login);
<a href="/SCR/SCR_Role.jsp?seq=<%=seq%>">...
Now my SCR.war file contains SCR_Role.jsp that shows different "roles" that that person has within the application...
SCR.war - SCR_Role.jsp:
loginInfo tLogin = (loginInfo)staticLoginInfo.getLogin((String)request.getParameter("seq"));
login.setUsername(tLogin.getUsername());
login.setPassword(tLogin.getPassword());
login.setDatabase(tLogin.getDatabase());
Believe it or not, this works. I thought that I would be able to just put login = (loginInfo)staticLoginInfo..., and this works for each page that I put this in; but by setting a temporary variable (tLogin), it carries throughout the rest of the application...
Thanks for all the help for those that tried...
Jim
</a>

Similar Messages

  • Is that a good practice to use syncronize methods for application scope cls

    Is that a good practice to use synchronize method in a application scope class, so I have a doubt, there a is class A, it has application scope and it contains a synchronized method add, so because of some network traffic or any unexpected exception client1 got stuck in the method, will that add method available for any other client...?
    Edited by: navaneeth.j on Dec 17, 2009 4:02 AM
    Edited by: navaneeth.j on Dec 17, 2009 4:04 AM

    If it needs synchronization, then it probably doesn't belong in the application scope. Either keep it as is, or reconsider the scope, or make it static.

  • Underlining in class diagrams

    Can anyone please explain the following?
    1) I have a class diagram where two of the three operations are underlined. The third operation is not underlined.
    2) In a second class diagram, all four attributes are underlined. None of the operations are underlined.
    (In the BankAccount class diagram in the tutorial, none of the attributes or operations are underlined.)

    From the IDE Help:
    http://www.netbeans.org/source/browse/*checkout*/uml/core/javahelp/org/netbeans/modules/uml/docs/basics/Attic/diagram_types_class.html?rev=1.1.2.2
    * Class. If the class type is abstract, the class name is displayed in italics.
    * Attributes. If an attribute is static (scope = class), the attribute name is underlined. If the attribute scope equals instance, the attribute name is not underlined.
    * Operations. If the operation type is abstract, the operation name is displayed in italics. If the property of an operation is static, the operation name is not italicized.
    Is the documentation here incomplete?

  • Row lock class concurrency Monitor

    Greetings,
    We are getting ready to release my first webapp and need a �row-locking� class of sorts. For example, when a user logs in they have choices of searches where they can query the db. There is a link in the reulstSet that brings them to a detail screen. If that �detail� or row is currently open in a browser, I want to know about it.
    I wonder about when a user closes their browser from the �detail� view, how can I know?
    I am thinking about using a filter to track all active 'rows' and using an application scope class to track the 'locked' rows. I am developing on a Mainframe db (DMSii) that has essentially no modern capabilities. We use struts as a framework and EAServer as a container.
    I could be so far from base that I am a spectator, so if there is any CONSTRUCTIVE advice or examples to point to, It would be greatly appreciated.
    thanks,
    mccools

    You can use Rowset, RowsetEvent and RowSetListener implementation for tracking the rows.
    "I wonder about when a user closes their browser from the �detail� view, how can I know?"
    For this you can use the SessionBindingListener implementation.
    Hope this helps.
    Regards,
    Rohan Kamat

  • Avoiding request scope bean clashes for task flow calls

    Hi,
    I have two task flows, Tf1 calls Tf2 using a task flow call activity. The structures of the task flows are as follows:
    Tf1
      Managed Bean: TfBean, request scope
        class Tf1Bean
          has property goTf2Button
      View: View1
        Button bound to #{TfBean.goTf2Button}
          Action -> task flow call to Tf2
    Tf2
      Managed Bean: TfBean, request scope
        class Tf2Bean
          has property testButton
      View: View2
        Button bound to #{TfBean.testButton}
    As you can see both have a request scope bean called TfBean but these are different classes in each. The bean classes have different properties for binding the components on the two pages.
    When I click the button in View1 to navigate I get an error telling me that class Tf1Bean does not have the property testButton. Clearly Tf2Bean is not being instantiated as TfBean already exists for the request.
    I'm guessing this is expected behaviour and it seems logical.
    My question however is what would be good standards or practices to avoid this?
    One way would be a naming convention, however what if I am consuming Tf2 from a library? In this case it would ideally work as a black box and I should not be concerned about it's implementation, specifically names chosen for internal managed beans. Even if it was not a problem initially, the developer of the task flow could add or change the name of a request scope bean introducing a conflict at a later stage.
    Thanks,
    Kevin

    Hi Frank,
    Good to meet you at UKOUG Tech13 yesterday. I changed my test case from request scope to backing bean scope. Unfortunately I still get the same error:
    <RichExceptionHandler> <_logUnhandledException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.faces.FacesException: javax.el.PropertyNotFoundException: The class 'yyy.view.Tf1Bean' does not have the property 'testButton'.
      at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1900)
      at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:446)
      at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
      at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:506)
      at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:744)
      at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1311)
      at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:67)
      at oracle.adfinternal.view.faces.unified.taglib.nav.UnifiedCommandButtonTag.doStartTag(UnifiedCommandButtonTag.java:51)
    ...etc.
    What I think is happening, please correct me if I'm wrong...
    Running Tf1, page View1 is displayed.
    Clicking the button on View1 initiates a request and an instance of Tf1Bean is instantiated for the managed bean named TfBean.
    During the request navigation occurs to Tf2 and hence page View2.
    View2 needs a property in TfBean called testButton.
    There is already a managed bean instantiated for this request called TfBean, however this is of class Tf1Bean and does not have the property.
    I have a simple workspace showing this if you want me to send it to you. I am using 11.1.2.4 by the way.
    Thanks,
    Kevin

  • Error: Could not start Service[keystone]: Execution of '/sbin/service openstack-keystone start' returned 1: Starting keystone: [FAILED]

    I'm using Oracle Linux 6u6. While I'm installing openstack ( 2 node set up) using packstack, I'm getting this error:
    Applying 10.245.33.37_cinder.pp
    10.245.33.37_keystone.pp:                         [ ERROR ]
    Applying Puppet manifests                         [ ERROR ]
    ERROR : Error appeared during Puppet run: 10.245.33.37_keystone.pp
    Error: Could not start Service[keystone]: Execution of '/sbin/service openstack-keystone start' returned 1: Starting keystone: [FAILED]
    You will find full trace in log /var/tmp/packstack/20150327-100335-ltC8Ic/manifests/10.245.33.37_keystone.pp.log
    Please check log file /var/tmp/packstack/20150327-100335-ltC8Ic/openstack-setup.log for more information
    Additional information:
    * A new answerfile was created in: /root/packstack-answers-20150327-100336.txt
    * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
    * Did not create a cinder volume group, one already existed
    * File /root/keystonerc_admin has been created on OpenStack client host 10.245.33.37. To use the command line tools you need to source the file.
    * To access the OpenStack Dashboard browse to http://10.245.33.37/dashboard .
    Please, find your login credentials stored in the keystonerc_admin in your home directory.
    Packages:
    [root@slcai461 ~]# rpm -qa|grep keystone
    python-keystoneclient-0.9.0-5.el6.noarch
    python-keystone-2014.1.3-2.el6.noarch
    openstack-keystone-2014.1.3-2.el6.noarch
    [root@slcai461 ~]# rpm -qa|grep packstack
    openstack-packstack-puppet-2014.1.1-0.12.dev1068.0.4.el6.noarch
    openstack-packstack-2014.1.1-0.12.dev1068.0.4.el6.noarch
    Log :
    [root@slcai461 ~]# cat /var/tmp/packstack/20150327-100335-ltC8Ic/manifests/10.245.33.37_keystone.pp.log
    Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
    Warning: Scope(Class[Keystone]): The sql_connection parameter is deprecated, use database_connection instead.
    Warning: Scope(Class[Keystone]): token_format parameter is deprecated. Use token_provider instead.
    Warning: Scope(Class[Keystone::Endpoint]): The public_address parameter is deprecated, use public_url instead.
    Warning: Scope(Class[Keystone::Endpoint]): The internal_address parameter is deprecated, use internal_url instead.
    Warning: Scope(Class[Keystone::Endpoint]): The admin_address parameter is deprecated, use admin_url instead.
    Warning: Scope(Class[Nova::Keystone::Auth]): The cinder parameter is deprecated and has no effect.
    Notice: Compiled catalog for slcai461.us.oracle.com in environment production in 1.60 seconds
    Warning: The package type's allow_virtual parameter will be changing its default value from false to true in a future release. If you do not want to allow virtual packages, please explicitly set allow_virtual to false.
       (at /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:816:in `set_default')
    Notice: /Stage[main]/Keystone/Keystone_config[DEFAULT/admin_token]/value: value changed '[old secret redacted]' to '[new secret redacted]'
    Notice: /Stage[main]/Keystone/Keystone_config[database/connection]/value: value changed '[old secret redacted]' to '[new secret redacted]'
    Notice: /Stage[main]/Keystone::Db::Sync/Exec[keystone-manage db_sync]: Triggered 'refresh' from 3 events
    Notice: /Stage[main]/Keystone/Exec[keystone-manage pki_setup]: Triggered 'refresh' from 2 events
    Error: Could not start Service[keystone]: Execution of '/sbin/service openstack-keystone start' returned 1: Starting keystone: [FAILED]
    Wrapped exception:
    Execution of '/sbin/service openstack-keystone start' returned 1: Starting keystone: [FAILED]
    Error: /Stage[main]/Keystone::Service/Service[keystone]/ensure: change from stopped to running failed: Could not start Service[keystone]: Execution of '/sbin/service openstack-keystone start' returned 1: Starting keystone: [FAILED]
    Notice: /Stage[main]/Keystone::Service/Service[keystone]: Triggered 'refresh' from 5 events
    Notice: /Stage[main]/Neutron::Keystone::Auth/Keystone_service[neutron]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Neutron::Keystone::Auth/Keystone_service[neutron]: Skipping because of failed dependencies
    Notice: /Stage[main]/Keystone::Roles::Admin/Keystone_tenant[admin]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Keystone::Roles::Admin/Keystone_tenant[admin]: Skipping because of failed dependencies
    Notice: /Stage[main]/Nova::Keystone::Auth/Keystone_service[nova_ec2]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Nova::Keystone::Auth/Keystone_service[nova_ec2]: Skipping because of failed dependencies
    Notice: /Stage[main]/Cinder::Keystone::Auth/Keystone_service[cinderv2]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Cinder::Keystone::Auth/Keystone_service[cinderv2]: Skipping because of failed dependencies
    Notice: /Stage[main]/Nova::Keystone::Auth/Keystone_service[novav3]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Nova::Keystone::Auth/Keystone_service[novav3]: Skipping because of failed dependencies
    Notice: /Stage[main]/Keystone::Roles::Admin/Keystone_tenant[services]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Keystone::Roles::Admin/Keystone_tenant[services]: Skipping because of failed dependencies
    Notice: /Stage[main]/Neutron::Keystone::Auth/Keystone_user[neutron]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Neutron::Keystone::Auth/Keystone_user[neutron]: Skipping because of failed dependencies
    Notice: /Stage[main]/Nova::Keystone::Auth/Keystone_user[nova]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Nova::Keystone::Auth/Keystone_user[nova]: Skipping because of failed dependencies
    Notice: /Stage[main]/Glance::Keystone::Auth/Keystone_user[glance]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Glance::Keystone::Auth/Keystone_user[glance]: Skipping because of failed dependencies
    Notice: /Stage[main]/Keystone::Roles::Admin/Keystone_role[admin]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Keystone::Roles::Admin/Keystone_role[admin]: Skipping because of failed dependencies
    Notice: /Stage[main]/Glance::Keystone::Auth/Keystone_user_role[glance@services]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Glance::Keystone::Auth/Keystone_user_role[glance@services]: Skipping because of failed dependencies
    Notice: /Stage[main]/Keystone::Endpoint/Keystone_service[keystone]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Keystone::Endpoint/Keystone_service[keystone]: Skipping because of failed dependencies
    Error: Could not prefetch keystone_endpoint provider 'keystone': Execution of '/usr/bin/keystone --os-endpoint http://127.0.0.1:35357/v2.0/ endpoint-list' returned 1: An unexpected error prevented the server from fulfilling your request. (HTTP 500)
    Notice: /Stage[main]/Keystone::Endpoint/Keystone_endpoint[RegionOne/keystone]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Keystone::Endpoint/Keystone_endpoint[RegionOne/keystone]: Skipping because of failed dependencies
    Notice: /Stage[main]/Main/Keystone_service[cinder_v2]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Main/Keystone_service[cinder_v2]: Skipping because of failed dependencies
    Notice: /Stage[main]/Main/Keystone_endpoint[RegionOne/cinder_v2]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Main/Keystone_endpoint[RegionOne/cinder_v2]: Skipping because of failed dependencies
    Notice: /Stage[main]/Nova::Keystone::Auth/Keystone_endpoint[RegionOne/novav3]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Nova::Keystone::Auth/Keystone_endpoint[RegionOne/novav3]: Skipping because of failed dependencies
    Notice: /Stage[main]/Cinder::Keystone::Auth/Keystone_service[cinder]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Cinder::Keystone::Auth/Keystone_service[cinder]: Skipping because of failed dependencies
    Notice: /Stage[main]/Cinder::Keystone::Auth/Keystone_endpoint[RegionOne/cinder]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Cinder::Keystone::Auth/Keystone_endpoint[RegionOne/cinder]: Skipping because of failed dependencies
    Notice: /Stage[main]/Glance::Keystone::Auth/Keystone_service[glance]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Glance::Keystone::Auth/Keystone_service[glance]: Skipping because of failed dependencies
    Notice: /Stage[main]/Glance::Keystone::Auth/Keystone_endpoint[RegionOne/glance]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Glance::Keystone::Auth/Keystone_endpoint[RegionOne/glance]: Skipping because of failed dependencies
    Notice: /Stage[main]/Nova::Keystone::Auth/Keystone_user_role[nova@services]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Nova::Keystone::Auth/Keystone_user_role[nova@services]: Skipping because of failed dependencies
    Notice: /Stage[main]/Keystone::Roles::Admin/Keystone_user[admin]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Keystone::Roles::Admin/Keystone_user[admin]: Skipping because of failed dependencies
    Notice: /Stage[main]/Keystone::Roles::Admin/Keystone_user_role[admin@admin]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Keystone::Roles::Admin/Keystone_user_role[admin@admin]: Skipping because of failed dependencies
    Notice: /Stage[main]/Cinder::Keystone::Auth/Keystone_user[cinder]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Cinder::Keystone::Auth/Keystone_user[cinder]: Skipping because of failed dependencies
    Notice: /Stage[main]/Nova::Keystone::Auth/Keystone_endpoint[RegionOne/nova_ec2]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Nova::Keystone::Auth/Keystone_endpoint[RegionOne/nova_ec2]: Skipping because of failed dependencies
    Notice: /Stage[main]/Cinder::Keystone::Auth/Keystone_endpoint[RegionOne/cinderv2]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Cinder::Keystone::Auth/Keystone_endpoint[RegionOne/cinderv2]: Skipping because of failed dependencies
    Notice: /Stage[main]/Nova::Keystone::Auth/Keystone_service[nova]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Nova::Keystone::Auth/Keystone_service[nova]: Skipping because of failed dependencies
    Notice: /Stage[main]/Nova::Keystone::Auth/Keystone_endpoint[RegionOne/nova]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Nova::Keystone::Auth/Keystone_endpoint[RegionOne/nova]: Skipping because of failed dependencies
    Notice: /Stage[main]/Neutron::Keystone::Auth/Keystone_user_role[neutron@services]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Neutron::Keystone::Auth/Keystone_user_role[neutron@services]: Skipping because of failed dependencies
    Notice: /Stage[main]/Neutron::Keystone::Auth/Keystone_endpoint[RegionOne/neutron]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Neutron::Keystone::Auth/Keystone_endpoint[RegionOne/neutron]: Skipping because of failed dependencies
    Notice: /Stage[main]/Cinder::Keystone::Auth/Keystone_user_role[cinder@services]: Dependency Service[keystone] has failures: true
    Warning: /Stage[main]/Cinder::Keystone::Auth/Keystone_user_role[cinder@services]: Skipping because of failed dependencies
    Notice: Finished catalog run in 3.10 seconds
    Please let me know how to fix this.

    This problem connected with proxy-setings.
    As the first steps you should try:
           1.  export system env variable:
    http_proxy=http://www-proxy.ru.oracle.com:80
    https_proxy=https://www-proxy.ru.oracle.com:80
    no_proxy=127.0.0.1,localhost
    and you can also export
        export OS_TENANT_NAME=admin
        export OS_USERNAME=admin
        export OS_PASSWORD=root
        export OS_AUTH_URL=http://<conntroller_IP>:5000/v2.0/
    2. and than restart mysqld, if it is running, stop iptables and repeat installation process from beginning with the currently generated answer file
    if we are exporting variable OS_PASSWORD, its value should be the same as value for CONFIG_KEYSTONE_ADMIN_PW in the currently generated answer file.
    This OS_PASSWORD will be written by packstack in the /root/keystonerc_admin file and will be used as admin's password for login to  Openstack dashboard.

  • JSF / Switch between HTTP and HTTPS

    Hello!
    I want to switch between HTTP and HTTPS using JSF.
    Under Apache Struts framework I can use struts extension "sslext.jar" to configure switching between http and https in one web application.
    e.g. Login-jsp should be secured, all other jsp's should run unsecured.
    Any ideas?
    regards
    Harald.

    Thanks,
    I made the necessary enhancement for the second phase, password confirmation required when return to SSL zone after leaving it after a succesful login.
    I did the following:
    1) create a class in the application scope and/or singleton class with the servlet paths that require SSL
    2) create a plugin that reads ActionConfigs from the ModuleConfig
    3) create a filter that sets a request scope flag that says that password must re-entered.
    Code Extracts:
    1) MainshopContainer application level parameter singleton class:
    private static HashMap sslZoneMap = new HashMap(50); // key = servlet path of request, example /login.do
    public boolean isInSSLZone(String servletPath)
    return this.sslZoneMap.containsKey(servletPath);
    public void addToSSLZone(String servletPath)
    this.sslZoneMap.put(servletPath,null);
    public int getNumberOfActionsInSSLZone()
    return this.sslZoneMap.size();
    2) Struts plugin
    add a call to loadSSLZoneMap in plugin init method:
    loadSSLZoneMap(config, mainshopContainer);
    private void loadSSLZoneMap(ModuleConfig config, MainshopContainer mainshopContainer)
    throws ServletException
    try {       
    ActionConfig[] actionConfigs = config.findActionConfigs();
    for (int i = 0; i < actionConfigs.length; i++)
    if (actionConfigs.getParameter().indexOf("/jsp/account/") < 0) // /account/* = URL path for SSL zone
    // not found = not ssl zone
    System.out.println("loadSSLZoneMap, following actionConfigs excluded from SSL Zone: "+actionConfigs[i].getPath());
    else
    // found = ssl zone
    String servletPath = actionConfigs[i].getPath()+".do";
    mainshopContainer.addToSSLZone(servletPath);
    System.out.println("loadSSLZoneMap, following servletPath added to SSL Zone: "+servletPath);
    System.out.println("loadSSLZoneMap, number of actions in SSL Zone: "+mainshopContainer.getNumberOfActionsInSSLZone());
    catch (Exception ex)
    ex.printStackTrace();
    throw new ServletException("Exception caught in loadSSLZoneMap: "+ex.toString()+" Initialization aborted.",ex);
    3)
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
    throws IOException, ServletException {
    HttpServletRequest req = (HttpServletRequest) request;
    HttpServletResponse res = (HttpServletResponse) response;
    String servletPath = req.getServletPath();
    boolean secure= this.mainshopContainer.isInSSLZone(servletPath);
    The wole picture:
    The filter adds a RequestDTO object that includes all request parameters, one of them is the secure flag.
    I have a session scope class UserContainer that includes all the session parameters, one of them is the lastRequestDTO.(last made request)
    At the end of all my jsp's I set the lastRequestDTO variable.
    In that method I set the passwordConfirmationRequired flag if needed:
    public void setLastRequestDTO(RequestDTO _lastRequestDTO)
    if (this.lastRequestDTO != null && this.lastRequestDTO.isSecure() != _lastRequestDTO.isSecure())
    this.setPasswordConfirmationRequired(true);
    this.lastRequestDTO = _lastRequestDTO;
    I read the passwordConfirmationRequired in all my jsp's in the SSL zone that allow editing or deleting and if that flag is true, a valid password must be re-entered in order to make the updates.
    When the password is OK I reset the passwordConfirmationRequired to false.
    I need some help for the first phase, that is SSL setup for all actions related to jsp's with url path /account/*
    I tought I could define it in the web.xml:
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>All Account Related Pages</web-resource-name>
    <url-pattern>/account/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    but that doesn't work and finnaly understood why:
    Example: /WEB-INF/jsp/account/login.jsp corresponds to /login.do
    The url pattern /account/* at the container level is never encountered.
    Is it allowed to declare the following action path: /account/login instead of /login?
    If yes I could add following prefix /account to all my action paths and forward paths and this could resolve my problem.
    What's your opinion?
    If no, would your library resolve this?
    Will all the Struts/JSP/JSTL url generating tags pick-up the required protocol (http/https) according to your configuration file?
    Regards
    Fred

  • Drag and Drop; What row is my drop positon (ADF 11g)

    Hello!
    I have a request for an drag and drop - site. First a test the technic with the examples in the web - great feature, but by my request i have one great problem.
    facts:
    two pannels, in all pannels are one af:table with different data controls
    - in the first pannel/table (source) i defined on a column a client attribute and the attributeDragSource
    - in the second pannel/table (goal) i defined on a PanelGroupLayout (surround a column) the dropTarget (inclusive dataFlavor)
    I definied a session-scope class and write the methode "public DnDAction handleItemDrop(DropEvent dropEvent)"
    Till then its work sucessful - the methode will be called and the transfer data can be read.
    problem:
    - I need the row for the drop position (for manual queuing).
    - I have found the component, the id of the component, the x and y - position of the drop.
    - A try with the current row of the IteratorBinding what returned the last marked row in the table, not the drop-position.
    I need a key (at best the value of a row.binding.Value) of the drop position in the table.
    Any idea - a simple code example?
    Harald

    Hi!
    My problem was not the correct component ... this information was already available, my problem was the correct row in the component.
    In the meantime I have found a result, i not sure it´s the best, but it works.
        public DnDAction handleItemDrop(DropEvent dropEvent) {
            System.out.println("demo1.java - handleItemDrop");
            try {
                DataFlavor<Number> d = DataFlavor.getDataFlavor(Number.class);
                //get drag Value
                Number dragValue = dropEvent.getTransferable().getData(d);
                if (dragValue == null)
                    return DnDAction.NONE;
                else {
                    // get the current record
                    ELContext elContext = FacesContext.getCurrentInstance().getELContext();  
                    // creating value expression with the help of the expression factory and the ELContext  
                    System.out.println("Component/Id of the drop value:"+dropEvent.getDropComponent().getId());
                    System.out.println("Value of the drop value (PK of the row):"+dropEvent.getDropComponent().getValueExpression("value").getValue(elContext));
                    // and now work with the available data
                    return DnDAction.COPY;
            } catch (Exception ex) {
                System.out.println("item drop failed with : " + ex.getMessage());
                return DnDAction.NONE;
        }

  • NiScope 2.1.4 and niScope 2.5

    After ungrading my niScope from 2.1.4 to 2.5 along with other new requirements, I notice my code that synchronizing 5 PXI5112s board stops with this error: Warning 0x3FFA4006 occured-The PLL is not locked. The code works fine with version 2.1.4. I use RTSI clock to sync the 10MHz clock line, RTSI_1 as the sync pulse, and RTSI_0 as the digital trigger source from master to other 4 slave boards. Also, the example code that comes with 2.5 which uses the new scope class (CNiScope) works fine, but the code that comes with the previous version ( uses the niScope_XXXXX functions ) will fails with the above error msg. My question is, is this a new warning msg that NI added in its new version? Or am I missing something in the configuration steps
    in the new niScope version? Thanks

    That explains a lot. Thanks. I mostly followed the code sample taken out of the 5112Sync example's configureBoard function. If you look at the code (came with 2.1.4, not 2.5), you'll get an idea how I initiate the synchronization. I think I will just use the PXI_CLOCK line for now.
    Both sample codes(2.1.4 and 2.5) use the RTSI clock line. When compiled under the new niScope version, the one(2.1.4) with the niScope_XXXXX functions will generate the warning msg while the new one with the new CNiScope class will not. Why? Did you do something with in the class to ignore this non-fatal error?
    I've got another question - when you route the RTSI_CLOCK, or the PXI_CLOCK for that matter, what does the third paramete
    r, the clockSyncPulseSource, in niScope_configureClock do? I've always thought the first parameter is the PLL source for synchronization.
    Again, thanks for the response.

  • Constructor in javabean

    Hi Everybody,
    I am new to JSP/JavaBean. I am facing a problem with Javabean. Constructor in the javabean is called everytime when the jsp file is accessed. Is there any way that constructor is initialised only once.
    Actually i have set connection object in constructor which is closed after logout(). But when i check resources i could find lots of connection object opened.
    Constructor
    public GSKBean() throws LDAPException
    conf=new Parameters(FILE_NAME);
    this.server=conf.getStringParam("adminServer");
    auth=new AuthBean(conf);
    anon=auth.getconnect(server);
    dir_access=new DirectoryAccessBean(anon,conf);
    JSP file
    <jsp:useBean id="gsklogin" class="com.GSKUtil.GSKBean"/>
    Can anyone tell me will Constructor from class GSKBean will be called everytime when JSP page is called.
    Do i have to give scope=session or something so that connection object could be reduced.
    What the alternative.
    thanks in advance.

    Hi,
    Thanks Greg for you kind Co-operation. I am in a dilema. Can i use scope=application, as session scope instantiate the class per session and as an Internet Application opening Connection Objects per session would consume more resources. Hence i am thinking will it be better if we keep scope=application. In this scope class instance would be instantiated only once keeping connection object only one the first time when its instantiated. But i need to know would that effect client accessing function of that class simultaniously. What will be the impact if i keep Application Scope. Is Session Scope Better option than Application Scope though Connection to Database is obtained from Bean Constructor. Is there any other convinient way to intialise connection to database so that only one connection to database is obtained. Any assistance would be highly appreciated.
    <jsp:useBean id="gsklogin" class="com.GSKUtil.GSKBean" scope="application"/>

  • Using == with String object references

    Hi,
    I understand that using the == operator to compare two String object references in Java will yield false for two different object references even when the contents are the same, and that you are supposed to use the method .equals() instead. However, in my program the == operator actually works for two different object references that point to the same object since it yields true! I don't understand why it works in my program when it shouldn't. Does someone know why?
    Thanks!

    overrule. wrote:
    warnerja wrote:
    ... unless some sneaky thread jumps in and changes the a or b reference right before the expression (a == b) were evaluated. This would also assume a or b had greater scope than simply local method variables that only one thread could access.
    Just being a nitpickCould you provide an example of how that "greater scope" may look like in this case.
    * Greater scope.
    * @author Cynthia G.
    * @see http://forums.sun.com/thread.jspa?messageID=10520796
    public class ObjectAssignmentTest {
      static Object a; // outer scope: class variable
      static Object b; // outer scope: class variable
      public static void main(String[] args) throws InterruptedException {
        a = new Object();
        b = a;
        new Thread(new Runnable() {
          public void run() { ObjectAssignmentTest.b = new Object(); }
        }).start();
        System.out.println(a == b ? "equal" : "not equal");
    }For the record, this code is not even guaranteed to make the objects unequal with == before their equality is tested; both threads may go in parallel, the main thread first or the modifying thread first!
    s

  • Overriding URL used in RMIHttpToCGISocketFactory

    Hi all !
    I am currently playing around the RMIHttpToCGISocketFactory solution for our RMI application. I am using tomcat 5.5 for the ServletHandler (to rout RMI calls to my RMI server). The webapp's web.xml file redirects the "/cgi-bin/java-rmi.cgi" to my servlet.
    Now, the problem I have is that this "/cgi-bin/java-rmi.cgi" is hardcoded in the RMIHttpToCGISocketFactory. I would like to override the method that returns the Socket, "createSocket(String, int)" :
    ===
    public Socket createSocket(String s, int i) throws IOException {
         return new HttpSendSocket(s, i, new URL("http", s, (new StringBuilder()).append("/cgi-bin/java-rmi.cgi?forward=").append(i).toString()));
    ===
    The problem I have is that the HttpSendSocket class used by this method is a package-scope class (sun.rmi.transport.proxy) so I cannot override the method in my own SocketFactory.
    The problem it causes me is that I am not able to put my ServletHandler enywhere but in the ROOT webapp of tomcat.
    All I want is to change the "/cgi-bin/java-rmi.cgi" in the method for something else.
    So far, the only solution I got was to copy all the classes from this package in my own package so I can create my own factory.
    Did anyone ran into this ?

    First of all, I need the RMIHttpToCGISocketFactory to use HTTPS instead of HTTP. Any hints?
    Secondl, you don't need to put the ServletHandler in the ROOT of the app. server.
    We did it like this (Tomcat 5):
    1) Create a webapps/cgi-bin directory.
    2) Copy all the files into that directory (ie: webapps/cgi-bin/WEB-INF/lib/, etc)
    3) edit the file webapps/cgi-bin/WEB-INF/web.xml and add the servlet and the mapping like this:
    [snip]
    <web-app>
            <servlet>
                    <servlet-name>RMI</servlet-name>
                    <servlet-class>YOURPACKAGENAME.ServletHandler</servlet-class>
                    <load-on-startup>1</load-on-startup>
            </servlet>
            <servlet-mapping>
                    <servlet-name>RMI</servlet-name>
                    <url-pattern>/java-rmi.cgi</url-pattern>
            </servlet-mapping>
    </web-app>
    [/snip] so the webapp is called cgi-bin and the servlet is mapped into /java-rmi.cgi, hence the URL is /cgi-bin/java-rmi.cgi
    Hope it helps!
    Regards.
    Julio.

  • Classloading in scoped memory

    Hello,
    currently I am trying to figure out how classloading in scoped memory can be done.
    I tried the following code which is executed by a RealtimeThread:
    public void run() {
    // allocation context is: heap
    final ScopedMemory scopeA = new LTMemory(50000);
    final ScopedMemory scopeB = new LTMemory(50000);
    // RtjTestClassloader simply loads a class from a .class-file that
    // exists somewhere in the filesystem
    final ClassLoader cloader = new RtjTestClassloader();
    try {
        // loading a class in scoped memory fails if no class was loaded
        // using that classloader before entering the scope
        Class<?> c = cloader.loadClass(OTHER_CLASS);
    } catch (ClassNotFoundException e) {
        System.exit(1);
    scopeA.enter(new Runnable() {
        public void run() {
            try {
                System.err.println("scopeA entered");
                Class<?> clazz = cloader.loadClass(CLASS);
                TestClass tc = (TestClass)clazz.newInstance();
                System.err.println("scopeA memory consumed: " + scopeA.memoryConsumed());
            } catch (Exception e) {
                e.printStackTrace();
    scopeB.enter(new Runnable() {
        public void run() {
            try {
                System.err.println("scopeB entered");
                System.err.println("scopeA memory consumed: " + scopeA.memoryConsumed());
                Class<?> clazz = cloader.loadClass(CLASS);
                TestClass tc = (TestClass)clazz.newInstance();
                System.err.println("scopeB memory consumed: " + scopeB.memoryConsumed());
            } catch (Exception e) {
                e.printStackTrace();
    }the output is:
    scopeA entered
    scopeA memory consumed: 16240
    scopeB entered
    scopeA memory consumed: 0
    scopeB memory consumed: 1896
    If the Class object would be allocated in scopeA it would not be possible to
    use that Class object in scopeB since classes can only be loaded once per
    classloader (the high memory consumption of scopeA is probably because of
    opening a file). That implies that classes must be allocated on the heap or in
    immortal memory. Is that the case in the Sun Java RTS?
    Furthermore the above code fails when run in TimeSys JVM. Trying to load the
    class in scopeA causes an IllegalAsignmentError when defineClass(...) is called.
    I suspect that is due to the storing of the reference to the loaded class for
    later use. Which would again imply that TimeSys really allocates memory for
    Class objects inside the scope.
    The same Error happened when I tried to load a class with a classloader that was
    instanciated in scoped memory (using Sun Java RTS).
    Another interesting notice is that the loading of the class in scopeA only works
    if the classloader was used to load a class in heap or immortal memory before
    entering the scope.
    What happens when a class is being loaded and scopes are involved? Is there an
    approach that should be used when having multiple classloaders and scopes?
    And is there anything in the RTSJ Spec on that? I wasn't able to find anything.
    Thank you,
    Matthias
    Edited by: user13696541 on 11.01.2011 13:46

    Hello,
    I have to push this topic, because it addresses a common question about the scenario of (user-defined) class loading in Real-Time Java, especially when mixed up with Scope usage.
    I'm wondering if user-defined Class Loading has been addressed yet in the RTSJ?
    Because of the absence of any statement about it within the RTSJ specification (or any of the well-known books about RTSJ),
    we assumed the problem is implementation-specific.
    Therefore we decided to do some tests, which Matthias has presented here in his previous post.
    The cited code above exemplifies a simple class loading scenario executed by a Real-Time JVM:
    A RealTimeThread enters a scope A and uses a Class Loader instance "cloader" residing on the Heap in order to load a certain class "CLASS" within that scope.
    On success, I would expect that the entire control structures defining the class "CLASS" are situated within the scope A.
    As you can see the program output, after the class loading procedure Class<?> clazz = cloader.loadClass(CLASS),
    there are about 16 Kbytes of scope A in use (e.g. something happened on class loading within that scope).
    Afterwards, the RT-Thread leaves the scope A, and according to it's memory usage (= 0) the latter seems to be already freed (e.g. no active threads therein anymore).
    This would impose, that the definition structures (or parts of them) of the class "CLASS" that were placed within the scope A are lost now, wouldn't it?
    However, this seems not to be the case.
    The RT-Thread enters a new scope B and tries to reload the same class "CLASS" with the same "cloader" instance residing on the heap.
    I would expect, that the "CLASS" is either redefined in some way within scope B, or that the JVM throws a kind of error since the definition for "CLASS" has been already lost with scope A.
    Nevertheless, "cloader" simply returns a valid Class object for the "CLASS" which can be further instantiated and used without any problems.
    But, the memory usage of scope B is much lower (= 1896 bytes) than that of scope A after defining the "CLASS".
    This raises a common question:
    1. Where does the JRTS JVM place Class Objects of newly defined classes (in terms of the Java "Class" object and the corresponding JVM-internal definition structures)?
    a) The current allocation scope of the Thread actually defining a class?
    b) Some other scope (e.g. a class cache) ?
    2. What happens in the scenario above? What is allocated on class loading within scope A, and how is it possible to have a valid class definition of "CLASS" since scope A has been freed?
    We've tried another use case, having a separate class loader object "rtcl" instantiated within a scope C, which again loads the class "CLASS" within the same scope C:
    mc.enter(new Runnable() {
                    public void run() {
                        try {
                            ClassLoader rtcl = new RtjTestClassloader();
                            Class c = rtcl.loadClass(CLASS3);
                            TestClass cl3 = (TestClass) c.newInstance();
                        } catch (Exception e) { e.printStackTrace(); }
    Output:
    Exception in thread "RealtimeThread-0" javax.realtime.IllegalAssignmentError
         at java.util.HashMap$Entry.<init>(HashMap.java:730)
         at java.util.HashMap.addEntry(HashMap.java:797)
         at java.util.HashMap.put(HashMap.java:431)
         at java.util.HashSet.add(HashSet.java:194)
         at java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:346)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:630)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:475)
         at rtjtests.classloader.RtjTestClassloader.loadClass(RtjTestClassloader.java:35)
         at rtjtests.classloader.ClassLoadingInScopeTest$3.run(ClassLoadingInScopeTest.java:138)
         at javax.realtime.MemoryArea.enter0(Native Method)
         at javax.realtime.MemoryArea.enter(MemoryArea.java:190)
         at javax.realtime.ScopedMemory.enter(ScopedMemory.java:191)
         at rtjtests.classloader.ClassLoadingInScopeTest.run(ClassLoadingInScopeTest.java:114)3. If I interpret the programs output right,
    - Class Loaders in JRTS seem to use traditional java.util.HashMap objects for storing references to their loaded classes
    - The class loading procedure really placed something on the scope (i.e. the class's Class object?)
    - For some reasons the class loader cannot store a reference to that object on the scope within its HashMap.
    Could anyone give us a short explaination of the internal representation of class objects and their corresponding class loaders?
    What are the reasons the RT-JVM behavior described above during our tests?
    Is there any intended or standardized way for the usage of extended class loading within RTSJ scopes?
    We would appreciate any help !
    Sincerely,
    Vladimir
    Edited by: vladimir.nikolov on Jan 17, 2011 5:05 AM
    Edited by: vladimir.nikolov on Jan 17, 2011 5:06 AM
    Edited by: vladimir.nikolov on Jan 17, 2011 5:07 AM

  • Followup on IVI drivers

    Hi,
    Thanks all for the help on IVI drivers.
    I want to develop a simple interface for a scope. I want to use IVI class
    drivers (the "green" drivers?) so that I am as hardware independant as
    possible. I have a simple example using the scope class drivers that I am
    happy with right now.
    I have drivers for my current scope, from lecroy. When I install these
    drivers, to
    $labview_path/instr.lib/lcwpxxx
    I don't get any files with a .dll extension. I can use instrument specific
    ("blue", right?) drivers from this set-up.
    I think I must have a .dll to be able to install a driver in max, then
    install a virtual instrument, then install a logical name?
    Is there something I can do to make this driver work?
    Thanks,
    Chad

    Thanks, that was the right place to look.
    "Dennis Knutson" wrote in message
    > Check your VXIpnp\Bin folder for the .dll. I believe you should also
    > have a separate folder for the instrument under VXIpnp if it was
    > installed correctly.

  • Error building using Coverity Prevent and Sun Studio 11

    We recently started using a static code-checking tool called Coverity Prevent. When we first started using it, we were on a very old verison of the Forte Compiler (Forte 6 update 2). Builds completed fine through Prevent. In the last month, we've upgraded to Sun Studio 11 (can't go to 12 because we're using Solaris 8). Now I can't get a build to run completely through Prevent. Prevent has a preprocessor that's a bit more strict than most compilers. I'm getting the following errors in a lot of places.
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/rw7/rw/defs.h", line 316: error #101:
    "istream" has already been declared in the current scope
    class _RWCLASSTYPE istream;
    ^
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/rw7/rw/defs.h", line 317: error #101:
    "ostream" has already been declared in the current scope
    class _RWCLASSTYPE ostream;
    ^
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/rw7/rw/defs.h", line 318: error #101:
    "ios" has already been declared in the current scope
    class _RWCLASSTYPE ios;
    ^
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/Cstd/iostream.h", line 4: error #101:
    "istream" has already been declared in the current scope
    using std::istream;
    ^
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/Cstd/iostream.h", line 9: error #101:
    "ostream" has already been declared in the current scope
    using std::ostream;
    ^
    I've googled a bit, and most of the solutions involve someone mistakenly putting "using namespace std" in a header file. I can't find any case where we do this in our code. One specific file that is failing includes one local header, and that header only includes <fstream.h> and <rw/cstring.h>. It seems like RW and std are conflicting with each other somewhere, but I can't figure out where. The compiler command looks like:
    /vobs1/cots/ForteDeveloper/SUNWspro/bin/CC -xildoff -instances=static -mt -g -fsimple
    -xlibmil -xO3 -xtarget=ultra -DUSE_VFU_LL_C -DXRT -KPIC -library=rwtools7_std -x
    libmopt -DRW_MULTI_THREAD -I/vobs1/cots/rogue/workspaces/SOLARIS7/SUNPRO50/12d -c c4i_file_stream.cpp
    We're still pointing at an older version of RW for the DBTools libraries (rebuilt using the compiler's internal Tools++), but we're using the compiler's internal Tools++ headers and libraries for everything else.

    It sounds like Prevent is not processing the #include directives, or possibly some other preprocessing directives, the same way as the Sun C++ compiler.
    The C++ Users Guide documents how #include directives are processed, and in particular the order in which directories are searched.
    [http://docs.sun.com/app/docs/doc/819-5267/bkaso?a=view]
    If Prevent provides similar documentation, you can compare the docs. If you see a difference, maybe Prevent has some options to control the behavior to make it work like the Sun compiler.
    Note: The CC driver passes some -I directives to the C++ compiler proper (ccfe) that do not appear on the CC command line that you write. The exact -I options depend on other options on the command line. Possibly Prevent is not using the same set of implicit -I directives.
    If you can't resolve the #include directive issue, you might need to talk to Coventry tech support.
    We at Sun are happy to work with 3rd-party vendors to help them get their products working correctly on Sun.

Maybe you are looking for

  • J2EE Security

    Hi! I'm starting developing my first j2ee application and i'm using weblogic server 6.1 as a j2ee application server. My application will consist in jsp pages in the presentation tier and enterprise java beans in the business tier. I would like to kn

  • Retaining changes and format  of  imported excel data.. please help.

    Is there some kind of secret that Im mising out on that will allow me to make changes to the data in the excel cell range in which I import to an InDesign document? It was working fine, until I had to add a line of data to the import field range, and

  • Logo to MS CRM 2011

    How can I add my company logo to MS CRM 2011 header? In 4.0 we used to change the image. But in 2011 that image appears in the middle of the header. how can make this left align?

  • MAC TO IPHONE (IPAD) FILE TRANSFER

    HI COLLEAGUES WE HAVE A MAC BOOK AIR+2 IPHONE+A IPAD. I KNOW HIW TO COPY (IMPORT) PHOTOS OR MOVIES TO MAC. CAN YOU EXPLAIN ME BY SIMPLEV WORDS HOW TO COPY A FILE (PHOTO,...) FROM MAC TO IPHONE (IPAD)? BY A DOMESTIC WAY THANKS

  • Timezone Offset to timezone conversion

    Hi , I have timezone offset +6:00 which is coming from xml. how to get time zone from it.