Maintain folder state in struts in a JSP

Hi
I had a requirement of displaying a group of folders in very large numbers in the corresponding Folder hierarchies in a JSP. I acheived it using Ajax calls. This is the set of steps we have adopted
1. When ever a user clicks a Open/Close/add file/delete file/add folder/delete folder to a folder, using Ajax we retrieved the whole result set into a XML, applied some styles to it(XSLT) and finally we make them displayed in the jsp using object. innerHTML = processResponse()method in Ajax.
2. while we dispay this entire Library tree in the JSP, we maintain the state of the folders in a map(Which contains the folder id's which are in expanded state) and that map is being attached to a session and thus we store the each FolderInfo and finally display the tree using XSLT.
3. I notice the state is always getting disturbed every time I perform the above mentioned actions, I see the entire tree with all the folders in expanded state(as the default value of the isExpand variable of the FolderInfo object is true.). Is this the correct way of preserving the Library Tree's state. If not so , please suggest an improvements of the existing process or an alternative one.
This process involves the role of map in the session across alll teh DAO and business layers and finally to the Presentaion layer.
Thanks

Yes, there are two ways (at least) to do that:
1. Map<String, ClientData> where String is the result of RemoteServer.getClientHost(). Use this in the case where there is only one instance of your remote object.
2. Allocate a remote object instance per client. I call this the Remote Session pattern. You make it so that the thing you look up in the Registry is really a factory, and your clients call a method on the factory to get their own instance, which is basically a remote session.

Similar Messages

  • How to maintain the state in Extn

    Dear all,
    I have created the extn using creative suite for photpshop. when i click my extn name, it will initilize everytime. e.g.if user login the extn and he/she will close the extn. Aftre that when user again hit on my extn. it will initilize, and ask for login again. how could i maintain the state in that case? Any suggestion or solution will appreciated..

    Hi,
    use a setPropertyListener to save the row key of this select item and then restore this key as the current selected key.
    Frank
    Ps.: I don't ask why you call clearForRecreate() on the iterator. I am sure you have a reason.

  • Maintain Jtable state!

    Hi,
    In my software I browse a lot of files, csv & xls files and load them onto JTable. Each jtable is in different JInternalFrame, now the problem is when I refine the data. How am I suppose to treat each Jtable as different and maintain its state?
    Eg. If there are two files FileA and FileB opened, and I want to add 5 to each value in FileA and add 8 in FileB then how do I do that simultaneously. The logic for calculating will be the same for both but they should be opening different panes for each and the calculation command is not given together they are given separately in their frames simultaneously by right clicking on the jtable

    Create a loop and updated each table separately.
    Other than that you question is too vague to give a better reply.

  • Maintaining financial statement items

    What is the TCode for Maintaining financial statement items ?
    Markus

    Hi,
    Why the financial statement (OB58) BAPT included the old and new alternative account, don't displayed the splited value?
    exemple :
    2009 622800 60,00u20AC account
    2010 622230 40,00u20AC account
    all standard reports based on financial statement BAPT, display the total value  (100,00u20AC) on the last alternative account (622230 ) and not the splited value.
    Thank you for your feed back.
    Rgds
    Francoise

  • Withholding tax maintain ITD state codes

    Hi,
    I need to configure in withholding tax 1). Maintain ITD state codes, 2). Assign ITD State Codes to Regions. Can you tell where i will get these two steps. please give path in ECC6.
    Regards,
    Venkat.

    HI Venkat,
    Please refer the note no 968208 for complete steps.
    Regards
    Madhu M
    http://wiki.sdn.sap.com/wiki/x/UgTpCw  (RUPEE WORD FORMAT)
    http://wiki.sdn.sap.com/wiki/x/8oMEDg  (J1INEMIS )
    http://wiki.sdn.sap.com/wiki/x/2BAMDg  (J1INACKN )
    http://wiki.sdn.sap.com/wiki/x/3xAMDg  (J1INCCREP)
    http://wiki.sdn.sap.com/wiki/x/6xYODg  (J1INREV  )

  • How I can use struts with uix jsp

    Hi,
    I want to use struts with uix jsp but I don't know how to set value of uix tag attribut by struts tag
    example :
    I want to change:
    <uix:globalHeader text="title" >
    by
    <uix:globalHeader>
    <bean:message key="title" arg0="Browse"/>
    </uix:globalHeader>
    N.B: I tried to use the tag <boundAttribute> but doesn't works
    Thanks in advance.

    Hi Ghazouani,
    From your sample code it looks like you are trying to use the Struts <bean:message> to provide internationalized text for the links in your globalHeader component. Couple of comments on this particular issue:
    - You'll need to add a <link> element to your globalHeader for each item that you want to display. So, instead of:
    <uix:globalHeader>
    <bean:message key="title" arg0="Browse"/>
    </uix:globalHeader>
    You'll want something which looks like this:
    <uix:globalHeader>
    <uix:link text="Browse"/>
    </uix:globalHeader>
    - If you want to bind the text for each link to some internationalized value which is pulled from a ResourceBundle, you should use the UIX JSP <bundle> data provider:
    <uix:bundle name="l10n" class="your.Bundle"/>
    <uix:globalHeader>
    <uix:link textBinding="title@l10n"/>
    </uix:globalHeader>
    In general when mixing JSP tags from different tag libraries, you need to be careful that you honor the semantics of each tag library. For example, in this particular case, the <uix:globalHeader> expects to have <uix:link> children - using any arbitrary tag (like <bean:message>) is not necessarily going to produce the desired results.
    As far as general UIX/Struts integration goes, we recommend using uiXML as a view for your Struts application. Check out the "Using uiXML with Struts" section of the UIX Developer's Guide for more info.
    Andy

  • Import statement in .java files and .jsp files

    Guys I have few mysteries about this import statement.
    Please correct me if I am wrong.
    1)Suppose if I have a folder c:\SourceFolder it has one.java and two.java files.If I compile one.java then one.class files is created in c:\ClassFolder .Now two.java uses one of the method of one.java,and without using import statement I am able to compile two.java, and two.class file is created in c:\ClassFolder.I assume that the path of one.class was taken from the CLASSPATH environment variable,hence I there was no need for import statement .........am i right ?
    BUT... in My.jsp,which is in C:\JspFolder, if I want to use one.class,then I have to specifically import the class I want to use.That is i have to say
    <%@page import="one"%>
    and since the classpath is C:\ClassFolder ,it finds one.class in the C:\ClassFolder.(Note that My.class is created in a folder different from c:\ClassFolder )
    But I am wondering why was there no need for me to import one.class in two.java.
    (Note I am using JDeveloper and Apache server)
    Please help.
    In this case the pSo I am wondering in JSP why it doesn't take the class I am looking for from the classpath .
    Help.

    You have to understand Java scoping rules. In the 1st scenario with the two Java files I am guessing neither one of them begins with a package statement. This means that they belong to the default package. When you compile the compiler uses the classpath to resolve method calls looking in the default package since there was no import statement specified in two.java. JSP is a little different. Now I just read this here in these forums a couple of days ago. Since the classfiles generated from the JSP files are not in the CLASSPATH they are loaded by a different classloader. This is why you have to import all references to all classes in the default package.

  • Import statement in .java files and .jsp files ..correction

    Guys I have few mysteries about this import statement.
    Please correct me if I am wrong.
    1)Suppose if I have a folder c:\SourceFolder it has one.java and two.java files.If I compile one.java then one.class files is created in c:\ClassFolder .Now two.java uses one of the method of one.java,and without using import statement in two.java I am able to compile two.java, and two.class file is created in c:\ClassFolder.I assume that the path of one.class was taken from the CLASSPATH environment variable,hence I there was no need for import statement .........am i right ?
    BUT... in My.jsp,which is in C:\JspFolder, if I want to use one.class,then I have to specifically import one.class in My.jsp .That is i have to say
    <%@page import="one"%>
    in My.jsp.
    and since the classpath is C:\ClassFolder ,it finds one.class in the C:\ClassFolder and MyJsp is compiled sucessfully.(Note that My.class is created in a folder different from c:\ClassFolder )
    But I am wondering why was there no need for me to import one.class in two.java.
    (Note I am using JDeveloper and Apache server)
    Please help.

    It has to do with packages. Most java classes are in a package, the name of which must conform to its place on the filesystem relative to the classpath. By that I mean that if you have com.mystuff.One.java, it must be in a folder com/mystuff where com is located somewhere in the classpath.
    What you've done is a little different. I'm assuming a couple of things:
    1. you have no package declaration at the top of one.java or two.java
    2. you have the current directory "." in your classpath.
    Java has the concept of the "default package", which covers classes without a declared package, and in your case is the current directory.
    So when you're in c:\sourcefolder and run the compiler, then "."="c:\sourcefolder", and that directory is part of the default package. No import statements are necessary for classes that are in the same package. This is why two.java can call methods in one.java without an import statement.
    When you run your jsp, the "current directory" part of your classpath is not c:\sourcefolder, but some other value (probably the directory you start your jsp engine from) You will have to import all non-java-library classes because the jsp itself becomes a java class, with a package that is determined by the jsp engine.

  • Problem using struts tags in .jsp

    I have a page that fills in the appropriate user information in text fields when viewed. The problem is, i want to have a text field that shows the full name, but i only have getter and setter methods for firstname and lastname in my form bean. Is there a way to combine firstname and lastname to display the fullname using the <html:text> tag ???

    You can use an ActionForm for your view that differs from the bean you are using. DynaActionForm would be ideal because it can be tedious to have a full complement of view beans that mirror your value objects.
    The idea is to loadup a DynaActionForm with the values for the view before the JSP is called in an Action. The following shows the parts of this and some code for execute() that creates DynaActionForm.
    If you have this bean in myapp/Contact.java
    package myapp;
    public class Contact {
    private String firstName,lastName;
    public String getFirstName() { return firstName; }
    public String getLastName() { return lastName; }
    public void setFirstName(String _firstName) { firstName = _firstName; }
    public void setLastName(String _lastName) { lastName = _lastName; }
    }Put this in the appropriatesecions in struts-config.xml
    <form-bean name="ContactActionForm" type="org.apache.struts.action.DynaActionForm">
    <form-property name="fullName" type="java.lang.String"/>
    </form-bean>
    <action path="/showContactForm"
            type="myapp.ShowContactActionForm">
      <forward name="success" path="/contactActionForm.jsp">
    </action>
    <action path="/handleContact"
            name="ContactActionForm"
            type="myapp.HandleContactActionForm">
      <forward name="success" path="/contactActionForm.jsp">
    </action>And for the execute method in the ShowContactActionForm put...
    Contact contact = db.getContact(contactId);
    ModuleConfig mc = _mapping.getModuleConfig();
    FormBeanConfig fbc = mc.findFormBeanConfig("ContactForm");
    DynaActionFormClass dafc =
    DynaActionFormClass.createDynaActionFormClass(fbc);
    DynaActionForm theForm = (DynaActionForm)dafc.newInstance();
    theForm.initialize(_mapping);
    theForm.set("fullName", contact.getFirstName() + " " + contact.getLastName());
    _request.setAttribute("ContactForm", theForm);
    fwd = _mapping.findForward("success");

  • Maintain financial statement in sap

    dear all
    we work with the following concept when we post any entry we enter fund in fund field because we activate fund mangement  , i need to create financial statement from report painter from transaction code fgi4 and i need to make classification depand on fund so i faced error masseage ( no charectristic for fund but when i press f4 i display all fun so please try to solve it asap
    thanks

    HI,
    yes it works like ATGFICO said. As an addition to this process you can authorise a user to a number of financial statement versions (eg User A is allowed to maintain FSV A, user B FSV B, user C FSV A+B,...) to ensure that FSV for local needs is maintained there FSV for group needs is maintained by group accounting,...
    We make it this way, as the alternative to create / ALE-transfer every new account number to development system, maintain the FSV versions there and transport the changes to production system is time consuming. The advantage of the first thing is, that functional department can handle FSV maintenance, NO IT support needed.
    BR Christian

  • WLS 8.1 sp1 with Struts 1.1 JSP with bean tag won't compile

              Hello,
              We are currently porting our application which uses struts 1.1 to WLS 8.1 sp1
              from another app server. Everything seems to deploy correctly and pages which
              use struts tags appear to compile and run fine. However, the pages with struts
              <bean:define> tags are not compiling.
              Example JSP Code:
              <bean:define id="userForm" name="userForm" scope="session" toScope="page" type="UserFormBean"/>
              <% if (userForm.hasUserData()) {hasUser=true;} %>
              WLS Console Output:
              ..jsp_servlet\_jsp\_sailor\__home.java:493: cannot resolve symbol
              symbol : variable userForm
              location: class jsp_servlet._jsp._sailor.__home
              if (userForm.hasUserData()) { //[ /jsp/sailor/home.jsp; Line: 38]
              When I look at the JSP's parsed java code (__home.java:493) I find that nowhere
              in the class is the variable userForm declared.
              Is this a bug in WLS? Does anyone know of a workaround?
              Thanks,
              Scott
              

    Please contact customer support [email protected] and request a patch for
              CR112789. AT_END tags do not work correctly in 81sp1
              --Nagesh
              "Scott Fleming" <[email protected]> wrote in message
              news:3f734c0d$[email protected]..
              >
              > Hello,
              >
              > We are currently porting our application which uses struts 1.1 to WLS 8.1
              sp1
              > from another app server. Everything seems to deploy correctly and pages
              which
              > use struts tags appear to compile and run fine. However, the pages with
              struts
              > <bean:define> tags are not compiling.
              >
              > Example JSP Code:
              >
              > <bean:define id="userForm" name="userForm" scope="session" toScope="page"
              type="UserFormBean"/>
              >
              > <% if (userForm.hasUserData()) {hasUser=true;} %>
              >
              > WLS Console Output:
              >
              > ..jsp_servlet\_jsp\_sailor\__home.java:493: cannot resolve symbol
              > symbol : variable userForm
              > location: class jsp_servlet._jsp._sailor.__home
              > if (userForm.hasUserData()) { //[ /jsp/sailor/home.jsp; Line:
              38]
              >
              > When I look at the JSP's parsed java code (__home.java:493) I find that
              nowhere
              > in the class is the variable userForm declared.
              >
              > Is this a bug in WLS? Does anyone know of a workaround?
              >
              > Thanks,
              > Scott
              

  • Which folder i have to put my .jsp file for web report?

    for web report(not the paper report) i put my .jsp files in the
    \reports\j2ee\reports_ids\web
    folder
    this is for the DS(Developer Suite)
    i'm trying to move this file to different machine where AS(Application Server)
    is installed.
    but couldn't find above path. where do i have to put .jsp file for
    web report?
    or do i have to modify in the registry? if so, where?
    Thanks

    Hello,
    Take a look to the thread :
    where to add new jsp reports directory location in path
    "...You have to keep jsp files under document root that is OH/j2ee/OC4J_BI_Forms/applications/reports/web directory. You can create sufbolders under this directory and keep jsp files. ..."
    Regards

  • Maintaining Session State

    Hello,
    Does anyone know how to maintain session and application variables through server restarts? I want to be able to shutdown and startup my Tomcat server without having the users lose their session and application variables (and consequently, their data and login state).
    Any ideas?
    Thanks!
    -David

    I dont think its possbile since stopping and restarting gets new sessions. Only way that I would know would be to use cookies.
    But then again i dont like the idea of saving passwords in cookies

  • Problems with maintaining session state using mod_ose

    I am using 9i AS(version 1.0.2.0) and oracle 8i(version 815).
    Because i need to maintain client sessions for my application, I
    have activated mod_ose(for stateful session). As suggested in
    the oracle documentation, i created a package containing
    variables for which state needs to be maintain per client. The
    state is maintained by the app server but it is not maintained
    properly. All the new clients that connect to the app server
    share the same session variable values. If I change a package
    variable value from one client, other clients take the same
    value.
    Any solution?
    Suggestions are most welcome.
    Thanks in advance.

    We installed oracle9i AS on solaris, configured OSE and the
    problem is not occuring now. Not sure whether its solaris that
    worked or 9i AS had some problem on NT machine earlier.
    Regards,
    Sharad

  • Maintain client state in server

    Can I maintain state for a specific client in rmi/jrmp server object (like ejb stateful session bean)?
    Thank you, Bobic.
    Edited by: 883271 on Sep 5, 2011 9:34 AM

    Yes, there are two ways (at least) to do that:
    1. Map<String, ClientData> where String is the result of RemoteServer.getClientHost(). Use this in the case where there is only one instance of your remote object.
    2. Allocate a remote object instance per client. I call this the Remote Session pattern. You make it so that the thing you look up in the Registry is really a factory, and your clients call a method on the factory to get their own instance, which is basically a remote session.

Maybe you are looking for