JspDynPage Problem

Hi,
I have developed an 2 applications.
1st application i have developed a custom tag.
2nd application i want to use that customal tag.
code in portalapp.xml:-
<component-profile>
<property name="cust"value="/SERVICE/customtags/taglib/lokesh.tld"/>
</component-profile>
here "customtags" :- is my application name.
If anyone could help me how the application is being stored when we deploy?
I mean to say the path where my application is being stored in the server.
Because here i am refering the previously loaded PAR.(i mean to say the application PAR).
lokesh.tld is my TLD file
code in my JSP page :-
<%@ taglib uri= "cust" prefix="mtags" %>
<mtags:lok/>
here lok is the name of my tag
Now my error is when i am deploying it is sowing the error
"java.lang.NullPointerException".
and also what is the meaning of "SERVICE"?
Please explain me that?
Thanks & Regards,
Lokesh

Hi,
I have developed an 2 applications.
1st application i have developed a custom tag.
2nd application i want to use that customal tag.
code in portalapp.xml:-
<component-profile>
<property name="cust"value="/SERVICE/customtags/taglib/lokesh.tld"/>
</component-profile>
here "customtags" :- is my application name.
If anyone could help me how the application is being stored when we deploy?
I mean to say the path where my application is being stored in the server.
Because here i am refering the previously loaded PAR.(i mean to say the application PAR).
lokesh.tld is my TLD file
code in my JSP page :-
<%@ taglib uri= "cust" prefix="mtags" %>
<mtags:lok/>
here lok is the name of my tag
Now my error is when i am deploying it is sowing the error
"java.lang.NullPointerException".
and also what is the meaning of "SERVICE"?
Please explain me that?
Thanks & Regards,
Lokesh

Similar Messages

  • JSPDynpage problem...plz help

    Hi All,
    I hv a Strange problem facing with Portal Component Project. I hv created Portal Component Project with two JSPDynpages :
    JSPDynpage1 - hving one Hyperlink Text
    JSPDynpage2 - Plain text and Images
    Whenever User clicks on Hyperlink in JSPDynpage1 will navigate to other JSPDynpage which show only plain text and images.
    I hv used following h ref to navigate from one to other
    href="http://someserver:50000/irj/servlet/prt/portal/prtroot/PDK
    Project.JSPDynpage"
    I hv created an IView based on JSPDynpage1. Everything works fine. IView is
    showing the Hyperlink and taking it to the next page. Finally I assigned this IView to page.....when the User clicks on Hyperlink it is prompting me give User Id and pwd.
    Also, Hyperlink shows underlined eventhough when I don't point mouse at hyperlink. I want to get rid of this one.
    Can anybody help me in this regards.... where I am going wrong. Any suggestion woudl be greatly appreciated and helpfull. Looking forward to your responses.
    Thanks in advance,
    Ravi Kumar.

    Hi Ravi,
    please check the permission property for the target iView: Right Click open -> Permissions. If you see the permission is only given for super admin or something like that then add the Everyone gorup to it and check on the End User checkbox. Save the permission set and then test to see what happens.
    Regarding the line coming below hyperlink - I think you need to change the design of the link a bit in order to get the hovering effect.
    Regards,
    Shubho

  • Problems using a static class extending JSPDynPage

    When I use the pdk with netweaver for creating a new portal object and I want to create a new PortalComponent (JSPDynpage) the pdk generates me the next code:
    public class TestJspDynPage extends PageProcessorComponent {
      public DynPage getPage(){
          return new TestJspDynPageDynPage(); }
      public <b>static</b> class TestJspDynPageDynPage extends JSPDynPage{
        public void doInitialization(){ }
        public void doProcessAfterInput() throws PageException {}
        public void doProcessBeforeOutput() throws PageException {}
    Is there any reason for creating the new class that extends JSPDynPage static ?
    Regards.

    Hi,
    That is a common problem, all variables in your JSPDynPage, should be saved in IPortalComponentSession/HttpSession instead of having instance/class variables.
    http://help.sap.com/saphelp_nw70/helpdata/en/fc/f28f414141a709e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/a0/3b7f41009d020de10000000a1550b0/frameset.htm
    Greetings,
    Praveen Gudapati

  • Problem with PAI (Process After Input) in JSPDynpage

    Hi All,
    I am implementing a file upload functionality through JSPDynpage. When I browse the excel file and try to upload it, it gives this error :
    com.sapportals.htmlb.page.PageException: Eventhandler- "upload_file" or "onUpload_file" not found!
         at com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:168)
         at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:115)
         at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    This is my component :
    public class FileUploadUtility extends PageProcessorComponent {
      public DynPage getPage(){
        return new FileUploadUtilityDynPage();
      public static class FileUploadUtilityDynPage extends JSPDynPage{
        private fileUpload fileUploadBean = null;
         protected IPortalComponentRequest request;
         protected IPortalComponentResponse response;
         protected IPortalComponentSession session;
         protected IPortalComponentContext context;
         protected IPortalComponentProfile profile;
         protected String userId;
         private final static int INITIAL_STATE = 0;   
         private final static int OUTPUT_STATE = 1;
         private final static int ERROR_STATE = 2; 
         private int state = INITIAL_STATE;
        public void doInitialization(){
              request = (IPortalComponentRequest) this.getRequest();
              session = ((IPortalComponentRequest)getRequest()).getComponentSession();
              context = request.getComponentContext();
              profile = context.getProfile();
              IUserContext userContext = request.getUser();
              userId = userContext.getUserId();
              System.err.println("berry + Getting userID " + userId);               
              fileUploadBean = new fileUpload();
              session.putValue("fileUploadBean", fileUploadBean);
              //uploadUtility();
        public void uploadUtility(){
              String mimetype;
              String resourceName;
              String repository;
              FileInputStream sourceFileInput = null;
              IPortalComponentRequest request = (IPortalComponentRequest)this.getRequest();
         /*     IWDClientUser wdUser = WDClientUser.getCurrentUser();
              IUser user = wdUser.wdUser.getSAPUser(); */
              IUser epUser=(IUser)request.getUser().getUser();
              System.err.println("epUser - " + epUser);
              ResourceContext ctx = new ResourceContext(epUser);
              repository = "/Folder1/Folder2";
              RID rid=RID.getRID(repository);
              System.err.println("getting RID :- " + rid);
              IPageContext context = PageContextFactory.createPageContext(request,response);
         //     PageContext context = PageContextFactory.createPageContext(request, response);
              Event event=context.getCurrentEvent();
              if(null!=event)
                   String event_name=event.getAction();
                   if(null!=event_name && event_name.trim().equalsIgnoreCase("upload_file"))
                        //FileUpload fileUpload = (FileUpload)context.getComponentForId("fileupload");
                        FileUpload fileUpload = (FileUpload)context.getComponentForId("fileupload");
                             if(null !=fileUpload && null!=fileUpload.getFile())
                                       mimetype = fileUpload.getFile().getContentType();
                                       resourceName = fileUpload.getFile().getFileName();
                                       //sourceFileInput = new FileInputStream(fileUpload.getFile().getFile().getAbsolutePath());
                                       try {
                                            sourceFileInput = new FileInputStream(fileUpload.getFile().getFile().getAbsolutePath());
                                       } catch (FileNotFoundException fnf) {
                                            System.err.print("FileNotFoundException Occured " + fnf.toString());
                                       Content content = new Content(sourceFileInput, mimetype, -1L);
                                       //IResource resource = (ResourceFactory.getInstance().getResource(rid, ctx));
                                       IResource resource = null;
                                       try {
                                            resource =(IResource) (ResourceFactory.getInstance().getResource(rid, ctx));
                                       } catch (ResourceException resexp) {
                                            System.err.print("Resource Exception Occured for IResource" + resexp.toString());                          }
                                       ICollection aCollection=(ICollection)resource;
                                       //IResource newResource = aCollection.createResource(resourceName, null, content);
                                       try {
                                            IResource newResource = (IResource) aCollection.createResource(resourceName, null, content);
                                       } catch (NotSupportedException e2) {
                                            System.err.print("Not Supported Exception Occured" + e2.toString());
                                       } catch (AccessDeniedException e2) {
                                            System.err.print("Access Denied Exception Occured" + e2.toString());
                                       } catch (ResourceException e2) {
                                            System.err.print("Resource Exception Occured for ICollection" + e2.toString());      
                                       }//end of catch
                        }//end of innermost if
              }//end of 2nd if
         }//end of 1st If
    }// end of uploadUtil
        public void doProcessAfterInput() throws PageException {
              uploadUtility();
        public void doProcessBeforeOutput() throws PageException {
          this.setJspName("File_Upload.jsp");
    Kindly help with expert suggestions :

    I put this
    public void onUpload_file (Event event) {
              uploadUtility();
    In my FileUploadUtilityDynPage.java and its still throwing the same error.
    {0}#1#com.sapportals.htmlb.page.PageException: Eventhandler- "upload_file" or "onUpload_file" not found!
         at com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:168)
         at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:115)
         at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    I've also imported import com.sapportals.htmlb.event.*;
    No relief!!

  • Problem getting jsp component from jspdynpage

    Hi,
      I am making a call in my java class in method
    doProcessBeforeOuput with the following call
    table = (TableView) this.getComponentByName("tableview_AddMaterial");
    Object[] objs = this.getComponents();
    Both return nulls for the object, how does someone access the jsp tables or text fields defined by id in htmlb in your java code I did check and all these are defined
    private IPageContext pageContext;
    private IPortalComponentRequest request;
    private IPortalComponentResponse response;
    private IPortalComponentSession session;
    private IPortalComponentContext userContext;
    private IPortalComponentProfile userProfile;
    Also here is my htmltable in the jsp
    <hbj:tableView
    id="tableview_AddMaterial"
    model="DHB.queryResultsModel"
    design="TRANSPARENT"
    headerVisible="false"
    footerVisible="true"
    visibleRowCount="50"
    visibleFirstRow="1"
    selectionMode="MULTISELECT">
    </hbj:tableView>
    Any help would be greatly appreciated and I do reward points for helpful answers
    Cheers,
    Devlin

    Hi Devlin
    You can access the fields in jsp as follows.For example, consider tableview with id "myTableView".
    <b>TableView table = (TableView) this.getComponentByName("myTableView");</b>
    If you add this line, you can get all the values related to tableview.For example, to get the first visible row of the tableview, the code goes as follows.
    <b>int firstVisibleRow = table.getVisibleFirstRow();</b>
    Jsp for the same:
    ==================
    <hbj:tableView
                        id="myTableView"
                        model="tablebean.model"
                        design="ALTERNATING"
                        headerVisible="true"
                        footerVisible="true"
                        selectionMode="MULTISELECT"
                        headerText="Office locations"
                        visibleFirstRow="1"
                        visibleRowCount="5"
                        rowCount="16"
                        width="500px">
                   </hbj:tableView>
    Try and let me know the results.
    Hope this helps.
    Regards
    Yoga

  • Export to Excel & Download in JSPDynpage

    Hi All,
    I have developed one JSpDynpage application in which I am displaying the custom portal activity report on portal page. I . I have used normal HTML code in JSP file. Now I have to export this data in Excel sheet & Download it.
    For this I have gone through these steps.
    1) As per the few suggestions on SDN , I have created seperate AbstractPortalComponent  for this functionality.
    2) I have followed prakash's blog i.e. Create an excel file from JAVA using HSSF api
    3) Included all needful POI jar files mentioned in the blog.
    But still i am getting error - java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
    This class  exists in JAR file when i checked. Error is looking simple, but not getting resolved.
    Also please suggest me -
    1) How to call this AbstractComp. from JSP file , when user click on a link on portal page.
    2) what shoud be the additional code for download functionality?
    Any sample code will be more helpful
    Regards,
    Vishal

    Hi Vishal,
    I am facing one problem with customization of portal activity report.
    We made some changes to the existing report par file and deployed from NWDS to dev system. When we previewed the existing iview in Dev portal system the changes reflected and once we exported the PAR file to QA system and previewed the iview from portal, there is no data coming to portal.
    Can you please let us know what could be the reason for this?
    Thanks
    Manas

  • Error while using jsp scriptlet or expression with JSPDynpage default jsp

    Hi everyone,
    I am getting the following error while trying to use any kind of jsp scriptlet or expression within the default jsp page that is created with JSPDynpage application:
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : Navroz_JSPDynPage_JCo_BAPI_FLCUST.FlightCustJSP
    Component Name : Navroz_JSPDynPage_JCo_BAPI_FLCUST.FlightCustJSP
    Error occurs during the rendering of jsp component.
    Exception id: 08:50_05/10/06_0032_17543050
    See the details for the exception ID in the log file
    For example if I try to use even simple syntax like:
    <% if(true) { %>
    display htmlb tableviewcomponent
    <% } %>
    or
    <hbj:tableView
         id="myTableView"
         model="flightCustomer.model"
         design="ALTERNATING"
         headerVisible="true"
         footerVisible="true"
         fillUpEmptyRows="true"
         navigationMode="BYLINE"
         selectionMode="SINGLESELECT"
         headerText="Flight Customer List"
         onNavigate="Navigate"
         visibleFirstRow="<%=flightCustomer.getVisibleFirstRow()%>"
         visibleRowCount="5"
         rowCount="16"
         width="500 px"
         />
    here also the <%=flightCustomer.getVisibleFirstRow()%> line gives the above mentioned error. If I remove such scriptlets or expression then it works fine.
    What could be the problem. Are jsp scriptlets or expressions incompatible with portal applications?

    hi Navroz,
    check this
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90e8e837-cc15-2a10-8db1-a87e2d29e9c9
    Re: Defining HTMLB tags in jsp file of JspDynPage component
    Re: JSPDynPage does not work in EP6.0
    bit more
    JspDynPage with Client Side Eventing and Database
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b3c1af90-0201-0010-c0ac-c8d802d264f0
    let me know u need any further info
    bvr

  • Getting error in consuming google webservices from JspDynPage

    Hi All,
    Getting following error while consuming google webservices from JspDynPage
    An exception occurred while processing a request for :
    iView : GoogleSer.google
    Component Name : GoogleSer.google
    Could not find portal application com.company.global.enterprise.portal.wsdl.webservices.service.
    Code :
    MyGoogle googleService =
    (MyGoogle) PortalRuntime.getRuntimeResources().getService("com.company.global.enterprise.portal.wsdl.webservices.service.MyGoogle");
    GoogleSearchResult result = googleService.doGoogleSearch("google", "SAP", 0, 10, false, "", false, "", "", "");
    ResultElement[] results = result.getResultElements();          
    if(results != null) {
    response.write("<br> Search Result Size " +results.length );
    for (int i = 0; i < results.length; i++) {
    response.write((i + 1) + ": " + results);
    Thanks
    Rudra

    Hi,
    I am still having the same problem, however the scenario in which I am getting varies.
    I am getting this exception:
    "com.sap.engine.services.webservices.jaxm.soap.accessor.NestedSOAPException: IOError while working with the message."
    Some users when trying to login into the portal are getting blank screen and for some the portal launcher page is loading fine and could go to the Home Page.
    When I view the logs I am seeing the Nested Soap Exception.
    Any Ideas??? Starting the J2EE engine also did'nt help.
    Thanks in advance.
    Madhavi

  • Warning message due to JSPDynpage

    Hi All,
    We have a scenario where in the jspdynpage we have only hyperlinks and One of the hyperlink is pointing to the standard uwl iview as follows
    [http://portalhostname:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fevery_user!2fgeneral!2fiViews!2fcom.sap.netweaver.bc.uwl.iviews!2fcom.sap.netweaver.bc.uwl.uwl_iview?sap-config-mode=true|http://portalhostname:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fevery_user!2fgeneral!2fiViews!2fcom.sap.netweaver.bc.uwl.iviews!2fcom.sap.netweaver.bc.uwl.uwl_iview?sap-config-mode=true]
    We are on CE7.1 and whenever I click on this hyperlink of jspdynpage, the uwl iview opens but with a warning msg  at the header of the UWL as follows
      "Another administrator is currently customizing this application. If you want to customize, please restart the application later and try again"
    Same UWL iview when I open  thru Home ->Work->UniversalWorklist , it does not show this warning message.
    Is it bcoz of any session object inthe jspdynpage? any pointers will be of great help.
    one note & Observation
    assume that all the users are logout from the portal now any user first logged into the portal then that warnong message is not displayed at the header level of the UWL iView which we are accessing thru the hyper link from the JSPDynpage . but second user onwards any number of users are logged into the portal and click on the hyperlink in the JSPDynpage and it goes to UWL Iview where it is showing the above mentioned warning message at the header level. it is happening the same for the second user, third user and all users consequently but this warning message is not displayed for the very first logged in user.
    Can anybody replys then it would be great help to us . <<text removed>>
    when we access those links directly from the browser it is not giving that above specified  warning message but  this warning message is getting displayed when we access those hyperlinks from JSPDynpage .it seems there is some session related problem or something related to that. pls help.
    Thanks
    Bindu
    Edited by: Hima Bindu on Apr 22, 2009 6:40 AM
    Edited by: Matt on Apr 22, 2009 3:46 PM - please do not offer rewards

    Hi Michael
    Excellent !!  .our issue has been resolved.
    Thank you very much & Thanks a lot for your help.
    Can you please tell me what the reason due to with ?sap-config-mode=true in the URL...??
    can you please give me the reason why this warning message is disappeared by removing the ?sap-config-mode=true.
    Thanks
    Bindu

  • Problem using target="_blank" in hbj:link

    Hello,
    we are having some problems when using "link" with the next piece of code:
    <hbj:link id="<%=objAccountStatus.getAccountNo()%>" text="View Inventory" tooltip="Download as an Excel Spreadsheet document" reference="" onClick = "onInventoryLinkClick" target = "_blank">Download Excel</hbj:link>
    The target is set to _blank but the Excel generated by using the link is opened in the same page. This problem occurs by using the Internet Explorer; on the other hand, this works fine in Firefox (in this case is opened in a blank screnn.
    Thanks in advance.
    Regards,
    Raúl.

    Thanks for you reply Pankaj, but the version I am using is IE 6.0.29.
    I have fixed the problem by modifying some code used in the event handled in the JSPDynPage becuase we were doing some things in the HTTP header that could have destroy the effect of the "target" parameter in the link.
    It was solved by other way.
    Thanks a lot for the help.
    Regards,
    Raúl.
    Message was edited by:
            Raul Rodriguez

  • Problem in exchange data using Bean

    Hi all,
    I have a problem when creating a portal application.
    I've done through the steps described in this link:
    http://www.ajvic.es/irj/portalapps/com.sap.portal.pdk.htmlb.htmlbmanuals/docs/dynpage-01.html
    In this example, I use bean to exchange data.
    In the function <b>doInitialization()</b> in JSPDynpage.java:
    public void doInitialization()
      // create the bean and set a default text value "unknown user
       IPortalComponentRequest request  = (IPortalComponentRequest) this.getRequest();     
       IPortalComponentContext myContext = request.getComponentContext();          
       IPortalComponentProfile myProfile = myContext.getProfile();
       // new bean object  
       UserNameContainer = new DynPageNameBean();
       // set default name
       UserNameContainer.setName("unknown user");
        // store bean in profile for the JSP
        myProfile.putValue("UserNameBean", UserNameContainer);
        // Now we set the state so that we can decide what action to do next
        state = INITIAL_STATE;     
    The code: <b>myProfile.putValue("UserNameBean", UserNameContainer);</b> give a warning: "The methode getValue(String) from the type IPortalComponentProfile is deprecated" and I see that the value of UserNameContainer is <b>not</b> assigned to "UserNameBean".
    If I use this code:
           UserNameContainer = (MyBeanClass) myContext.getValue("MyB");
         UserNameContainer.setName(name);
    The result is the same.
    Do you know how to solve this problem ?
    Thank you in advance & kindly regards.
    Tweety

    Hi
    Here is what you should do.
    First The Bean
    public class UserBean implements Serializable {
    private String name;
    public String getName() {
         return name;
    public void setName(String string) {
         name = string;
    Next the Dynpage DoInitialization Method .
         IPortalComponentRequest request =
                        (IPortalComponentRequest) this.getRequest();
                   UserBean myBean = (UserBean) request.getComponentSession().getValue("myBean");
                   if (myBean == null) {
                        myBean = new UserBean();
                   myBean.setName("Unknown User");
    request.getComponentSession().putValue("myBean",myBean);
    this.state = INITIAL_STATE;
    Next the JSP
    <%@ taglib      uri="tagLib" prefix="hbj" %>
    <jsp:useBean
         id="myBean"
         scope="session"
         class="UserBean"
         />
    <html>
         <hbj:content
              id="myContext">
              <hbj:page
                   title="PageTitle">
                   <hbj:form
                        id="myFormId">
                                                                                              <hbj:textView
                             id="s1" >
                             <%
    s1.setText(myBean.getName());
                             %>
                        </hbj:textView>                    
                   </hbj:form>
              </hbj:page>
         </hbj:content>
    </html>
    Regards
    Rajendra

  • Axis Problem while using Quick Address

    Hi all,
    we are developing  a JSPDynPage using a code developed by us using a third part JAR file of Quick Address to use the Quick Address Pro Web tool. Without entering to describe the functionality. The same Java lines used in a Java standalone program with a main method works fine without problems and by inserting the same lines into a JSPDynPage code we had the next error:
    [email protected]: Bad envelope tag:  html #
         at com.qas.proweb.QasException.createFrom(Unknown Source)#
         at com.qas.proweb.QuickAddress.mapRemoteExeption(Unknown Source)#
         at com.qas.proweb.QuickAddress.search(Unknown Source)#
         at com.qas.proweb.QuickAddress.search(Unknown Source)#
         at com.qas.proweb.QuickAddress.search(Unknown Source)#
         at com.qa.mycompany.qas.QasTest$QasTestDynPage.returnAddresses(QasTest.java:142)#
         at com.qa.mycompany.qas.QasTest$QasTestDynPage.doInitialization(QasTest.java:74)#
         at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:105)#
         at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)#
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)#
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)#
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)#
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)#
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)#
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)#
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)#
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)#
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)#
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)#
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)#
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:232)#
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)#
         at java.security.AccessController.doPrivileged(Native Method)#
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)#
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)#
         at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:153)#
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)#
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)#
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)#
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)#
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)#
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)#
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)#
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)#
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)#
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)#
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)#
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)#
         at java.security.AccessController.doPrivileged(Native Method)#
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)#
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)#
    The qas.proweb package is a third party code in a jar file imported in the Project developed in Netweaver and it compiles and executes fine but this is the error it gives us in the log, showing some problem with the connexion. This qas.proweb runs by using SOAP and probably the problem will be some compatibility issue with this in the Portal.
    The code used in the JSPDynPAge to acces qas.proweb is the same as the one working in a Java program with a main method requesting data against the same machine.
    It could be some issue with axis and the SAP Portal.
    What do you think about this error??
    Thank you in advance.
    Regards,
    Raúl.

    I solved the problem by installing only the JAva part, without the ABAP part.

  • How to call the Jsp file in JspDynpage

    Hello,
    I am using the following jsp code. I saved it as Thumbnail1.jsp.
    <%@page import ="com.sun.image.codec.jpeg.*" %>
    <%@page import ="java.awt.*" %>
    <%@page import ="java.awt.image.*" %>
    <%@page import ="java.io.*"%>
    <%
        // load image from INFILE
             Image image = Toolkit.getDefaultToolkit().getImage("C:/kasturi/sap1.jpg");
         MediaTracker mediaTracker = new MediaTracker(new Container());
            mediaTracker.addImage(image, 0);
             mediaTracker.waitForID(0);
        // determine thumbnail size from WIDTH and HEIGHT
             int newImageWidth = Integer.parseInt("100");
             int newImageHeight = Integer.parseInt("100");
             double newImageRatio = (double)newImageWidth / (double)newImageHeight;
             int oldImageWidth = image.getWidth(null);
              int oldImageHeight = image.getHeight(null);
              double oldImageRatio = (double)oldImageWidth / (double)oldImageHeight;
              if (newImageRatio > oldImageRatio)
                    newImageWidth = (int)(newImageHeight * oldImageRatio);
          else
              newImageHeight = (int)(newImageWidth / oldImageRatio);
        // draw original image to thumbnail image object and
        // scale it to the new size on-the-fly
             BufferedImage newThumbImage = new BufferedImage(newImageWidth, newImageHeight, BufferedImage.TYPE_INT_RGB);
              Graphics2D graphics2D =newThumbImage.createGraphics();
                 graphics2D.drawImage(image, 0, 0, newImageWidth, newImageHeight, null);
        // save thumbnail image to OUTFILE
               BufferedOutputStream outFile = new BufferedOutputStream(new  FileOutputStream("C:/kasturi/ssa.jpg"));
              JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(outFile);
              JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(newThumbImage);
                encoder.setJPEGEncodeParam(param);
              encoder.encode(newThumbImage);
              outFile.close();
              System.out.println("Successfully Saved.");
    %>
    I want to call this thumnail1.jsp file JspDynpage. Can any help me how to make that?
    Thanks in advance.

    hello,
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="Test">
          <component-config>
            <property name="ClassName" value="kasturi.Test"/>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="pagelet/Thumbnail1.jsp"/>
            <property name="SecurityZone" value="high_safety"/>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services/>
    </application>
    this is my portalapp.xml file. Still i am getting error.
    i don't know the exact error. i think it may be java code problem.
    can you tel me what is that? thanks in advance.
    Message was edited by: kasturi ramalingam

  • Store Client - strange problem

    Hi
    I've problem with store client. It open and function OK (I can search for files, change settings etc  but it dosnt download files)
    Today I've downloaded many files with it (about 20) and all works fine but on the last 5 files it has stopped and nothing happens (seems like server on the other side is off) All other applications and connections works fine
    I try many things (reinstall app, restart phone) without succses

    Hello All,
    Thanks for the reply. The problem got solved. There was a bug in the controller program. The JSP part is working fine now. Now I am facing another issue. The bean that i am having in the session is not available in the result jsp.
    The following are the piece of codes that i use for session tracking..
    JSPDynPage: doInitialization()
             IPortalComponentRequest request = (IPortalComponentRequest)this.getRequest();
              IPortalComponentSession session = request.getComponentSession();
             dataBean = new FR100Class();
            session.putValue("clientData",dataBean);
    and I am setting few values for the Bean in the onClick event of JSPDynPage and few by calling an external java class say c1 by passing this bean instance to c1's void method(doesn't return any value).
    Initial JSP:
    <jsp:useBean id="FR100Bean" scope="session" class="com.test.fr100.FR100Class" />
    Result JSP:
    <jsp:useBean id="FR100Bean" scope="session" class="com.test.fr100.FR100Class" />
    Here when i tried to read FR100Bean.getName() it returns null.
    Where have i gone wrong?
    Thanks in advance.
    Nathan.

  • JSP TableView Sorting Problem

    I have been trying to get a tableview to be sortable by clicking on the header of columns.  I have been reviewing existing threads on the forum in particular the one below.
    https://forums.sdn.sap.com/thread.jspa?threadID=16417
    I seem to understand the concept but for some reason my table does not sort, it just does nothing.  Could someone take a look and see if you can find any problems - I can't wait to give points.
    Here is all my code.
    Here is the Java....
    package MSSPackage;
    import MSSBeanPackage.PositionOverviewBean;
    import MSSPackage.SortTableModel;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.prt.component.IPortalComponentContext;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentSession;
    import com.sapportals.htmlb.event.*;
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.table.*;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    import javax.servlet.http.*;
    // SAP RFC Imports
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.JCO;
    import com.sapportals.portal.prt.service.jco.IJCOClientPoolEntry;
    import com.sapportals.portal.prt.service.jco.IJCOClientService;
    import com.sapportals.portal.prt.runtime.PortalRuntime;
    import java.util.*;
    public class PositionOverview extends PageProcessorComponent {
      public DynPage getPage(){
         return new PositionOverviewDynPage();
      public static class PositionOverviewDynPage extends JSPDynPage{
         JCO.Repository mRepository;
         public JCO.Table tblRelations;
         public JCO.Table tblPositions;     
         public SortTableModel tableModel;
         public int visibleRow = 1;     
         private boolean OrgUnitSelected = false;
         public void doInitialization(){
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean oBean = new PositionOverviewBean();
              // Table Start row
              oBean.setvisibleRow(new Integer(this.visibleRow).toString());          
              oSession.putValue("myBean", oBean);
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
              IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              // Define bean reference to bean
              PositionOverviewBean myBean = new PositionOverviewBean();
              // Table Start row
              myBean.setvisibleRow(new Integer(this.visibleRow).toString());
              // Place bean in user profile.          
              myProfile.putValue("myBean", myBean);
         public void doProcessAfterInput() throws PageException {
         public void doProcessBeforeOutput() throws PageException {
              String NavType = "RCORGUNIT";
              String OType = "O";
              //String OBjid = "10004399";
              String OBjid = "";
              String sapSystem = "SAP_R3_HumanResources";          
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean myBean = (PositionOverviewBean) oSession.getValue("myBean");
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    /*          IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              //HttpSession session = request.getServletRequest().getSession();          //dmm
              //Get Bean from Profile
              PositionOverviewBean myBean = (PositionOverviewBean) myProfile.getValue("myBean");
              //PositionOverviewBean myDataBean = (PositionOverviewBean) session.getValue("POviewBean");               //dmm
              String ddlbSelection = "";
              String ddlbValue = "";
              DropdownListBox ddlbOrgUnits = (DropdownListBox) getComponentByName("ddlbOrgUnits");
              if (ddlbOrgUnits != null)
                   ddlbSelection = ddlbOrgUnits.getSelection();
                   ddlbValue = ddlbOrgUnits.getValueAsDataType().getValueAsString();
                   OBjid = ddlbValue;
                   myBean.setObjId(OBjid);
              else
                   OBjid = "";
                   myBean.setObjId(OBjid);                 
              IJCOClientService clientService;
              IJCOClientPoolEntry poolEntry;          
              JCO.Client client;          
              try
                   clientService = (IJCOClientService) PortalRuntime.getRuntimeResources().getService(IJCOClientService.KEY);
                   poolEntry = clientService.getJCOClientPoolEntry(sapSystem, request);
                   client = poolEntry.getJCOClient();
                // connect to SAP system, logon
                   client.connect();
                // Create Jco Repository Object
                   mRepository = new JCO.Repository("R3USERMENU", client);
                // Reset function object
                   JCO.Function function = null;
                // Run RFC Module on SAP system
                   function = this.createFunction("HRWPC_GET_NAV_OBJECTS");
                   JCO.ParameterList input = function.getImportParameterList();
                   input.setValue("RCORGUNIT", "NAVTYPE");               
                   client.execute(function);
                   tblRelations = function.getTableParameterList().getTable("RESULT_OBJEC");
                   myBean.setRowcnt(tblRelations.getNumRows());
                   if (tblRelations.getNumRows() != 0)               
                        myBean.setOrgUnits(tblRelations);
                        if (ddlbOrgUnits == null)
                             // check to see if there is not a position id already assigned
                             tblRelations.setRow(0);
                             OBjid = tblRelations.getString("OBJID");
                             myBean.setObjId(OBjid);
                             //myBean.sTemp = OBjid;                         
                   // GET THE POSITION DETAILS
                   function = null;
                   input = null;
                   function = this.createFunction("Z_GET_POSITION_OVERVIEW");
                   input = function.getImportParameterList();               
                   input.setValue(NavType, "NAVTYPE");               
                   input.setValue(OType, "OTYPE");
                   input.setValue(OBjid, "OBJID");               
                   client.execute(function);
                   tblPositions = function.getTableParameterList().getTable("RESULT_OBJEC");
                   myBean.setRowcnt(tblPositions.getNumRows());
                   tableViewFormat();
                   tableModel.setTesting("Startxxxx");
                   myBean.settableModel(tableModel);
                   //tableModel.setTesting("SSSS");               
                   //myDataBean.settableModel(tableModel);                                             //dmm               
                   //session.setAttribute("POviewBean", myDataBean);                                //dmm
                   oSession.putValue("myBean", myBean);
              //Release pool entry
              poolEntry.release();                           
           catch(Exception ex)
                //name = ex.getMessage();                         
           //String sTest = "this is a test";      
           //request.getComponentSession().putValue("Test", sTest);
           //myProfile.putValue("Testx", sTest);
           this.setJspName("PositionOverviewJSP.jsp");
         public void getPositions()
              String NavType;
              String Root_Ot;
              String Root_ObjId;
         public void tableViewFormat()
              // Define the vectors used to build tableView
              Vector tempRec = new Vector();
              Vector dataRec = new Vector();
              String sDate = "";
              String sPosLink = "";
              String sPosVal = "";
              String sENameLink = "";
              String sENameVal = "";
              String sStatus = "";
              // Loop at company code list and add to vectors
              for (int i = 0; i < tblPositions.getNumRows(); i++)
                   tblPositions.setRow(i);
                   tempRec = new Vector();
                   sStatus = (String) tblPositions.getString("STATUS");
                   if (sStatus != null)
                        if (sStatus.equals("0"))                    
                             sDate = tblPositions.getString("ZHR_VACANT_BEGDA");
                             sDate = sDate.substring(5, 7) + "/" + sDate.substring(8, 10) + "/" +  sDate.substring(0, 4);                         
                        else
                             sDate = "";                    
                   sPosVal = tblPositions.getString("STEXT");
                   sENameVal = tblPositions.getString("ENAME");
                   if (sPosVal.equals(""))
                        sPosLink = sPosVal;
                   else
                        sPosLink = "<a HREF="myLink" onclick="return EPCM.doNavigate('ROLES://portal_content/com.sap.portal.migrated/ep_5.0/pages/com.sap.pct.hcm.positionprofile?CKey=000000" + tblPositions.getString("OBJID") + "', 1)">" + tblPositions.getString("STEXT") + "</a>";
                   if (sENameVal.equals(""))
                        sENameLink = sENameVal;
                   else
                        sENameLink = "<a HREF="myLink" onclick="return EPCM.doNavigate('ROLES://portal_content/com.phi/com.phi.mgt/com.phi.mss/com.phi.hr/com.phi.pages/com.phi.mgt.mss.hr.pages.positionholder?CKey=000000" + tblPositions.getString("OBJID") + "', 1)">" + tblPositions.getString("ENAME") + "</a>";
                   tempRec.addElement(sStatus);
                   tempRec.addElement(tblPositions.getString("OBJID"));
                   tempRec.addElement(sPosLink);
                   tempRec.addElement(sENameLink);
                   tempRec.addElement(sDate);               
                   dataRec.addElement(tempRec);
              // Then define the technical column names
              Vector colNames = new Vector();
              colNames.addElement("STATUS");
              colNames.addElement("OBJID");
              colNames.addElement("STEXT");     
              colNames.addElement("ENAME");
              colNames.addElement("ZHR_VACANT_BEGDA");
              // Now we build the actual tableView
              //tableModel = new DefaultTableViewModel(dataRec, colNames);
              tableModel = new SortTableModel(dataRec, colNames, 5);     
              // Define tableView parameters
              tableModel.setKeyColumn(2);
              TableColumn column = tableModel.getColumn("STATUS");
              column.setEncode(false);
              column.setType(com.sapportals.htmlb.enum.TableColumnType.USER);
              column.setTitle("Vacant");
              column = tableModel.getColumn("OBJID");
              column.setTitle("Position Number");
              column = tableModel.getColumn("STEXT");
              column.setTitle("Position");
              column = tableModel.getColumn("ENAME");
              column.setTitle("Holder of Position");          
              column = tableModel.getColumn("ZHR_VACANT_BEGDA");
              column.setTitle("Vacant as of");
         //     * Navigation Button Clicked
         public void myOnNavigate(Event event)
              TableNavigationEvent tne = (TableNavigationEvent) event;
              visibleRow = tne.getFirstVisibleRowAfter();
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
              IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              // Get Bean from profile
              PositionOverviewBean myBean = (PositionOverviewBean) myProfile.getValue("myBean");
              // Table Start row
              myBean.setvisibleRow(new Integer(this.visibleRow).toString());
         public void onHeaderClick(Event event)
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean myBean = (PositionOverviewBean) oSession.getValue("myBean");
              TableHeaderClickEvent tne = (TableHeaderClickEvent) event; // get the event
              SortTableModel tblModel = myBean.gettableModel();
              //tblModel.sort();
              int col = 3;
              tblModel.sortByColumn(col);
              myBean.settableModel(tblModel);
              oSession.putValue("myBean", myBean);
         // Create Function object for RFC Calls
         public JCO.Function createFunction(String name) throws Exception
              try
                   IFunctionTemplate ft = mRepository.getFunctionTemplate(name.toUpperCase());
                   if (ft == null)
                        return null;
                   return ft.getFunction();
              catch (Exception ex)
                   ex.printStackTrace();
                   throw new Exception("Problem retrieving JCO.Function object");
         public void onSelectddlbOrgUnits(Event event) throws PageException
              OrgUnitSelected = true;          
    Here is the JSP
    <%@ page import="com.sap.mw.jco.*" %>
    <%@ page import="com.sapportals.htmlb.enum.*" %>
    <%@ page import="MSSPackage.TableViewCellRenderer" %>
    <%@ page import="com.sapportals.portal.prt.component.IPortalComponentRequest" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="com.sapportals.portal.prt.component.IPortalComponentContext" %>
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
         <hbj:page title="PageTitle">
              <hbj:form id="myFormId" >  
              <jsp:useBean id="myBean" scope="session" class="MSSBeanPackage.PositionOverviewBean" />     
                   <hbj:gridLayout rowSize="1" columnSize="1" cellSpacing="1">
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="1">
                             <hbj:textView id="ddlbLable" text="Select organizational unit to display positions" design="STANDARD" />
                        </hbj:gridLayoutCell>                         
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="2">
                             <hbj:dropdownListBox id="ddlbOrgUnits" onSelect="onSelectddlbOrgUnits" selection="<%=myBean.getObjId()%>">                                                       
                                  <%                         
                                       JCO.Table org_units = null;                                                       
                                       org_units = myBean.getOrgUnits();
                                       for (int i = 0; i < org_units.getNumRows(); i++)
                                            org_units.setRow(i);
                                            String sUnit = org_units.getString("STEXT");
                                            String Unit_Id = org_units.getString("OBJID");
                                  %>
                                  <hbj:listBoxItem key="<%=Unit_Id%>" value="<%=sUnit%>" />
                                  <%
                                  %>
                             </hbj:dropdownListBox>                                                                                                   
                        </hbj:gridLayoutCell>
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="3">
                             <hbj:textView id="listLable" text="To designate a vacant position, click the icon in the 'Create Form' column" design="STANDARD" />                    
                        </hbj:gridLayoutCell>                    
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="4">     
                             <hbj:tableView
                                  id="myTableView"
                                  headerVisible="true"
                                  footerVisible="true"
                                  fillUpEmptyRows="true"
                                  selectionMode="NONE"                              
                                  navigationMode="BYPAGE"
                                  onNavigate="myOnNavigate"                                        
                                  visibleFirstRow="<%= myBean.getvisibleRow() %>"                                                  
                                  visibleRowCount="5" >                                                            
                                  <%
                                  myTableView.setOnHeaderClick("onHeaderClick");
                                  myTableView.setUserTypeCellRenderer(new TableViewCellRenderer());                                                             
                                  myTableView.setModel(myBean.gettableModel());
                                  myTableView.setColumnType(TableColumnType.LINK, 3);
                                  myTableView.setColumnType(TableColumnType.LINK, 4);                              
                                  %>
                             </hbj:tableView>
                        </hbj:gridLayoutCell>                                        
                   </hbj:gridLayout>   
              </hbj:form>
         </hbj:page>
    </hbj:content>
    Here is the BEAN
    package MSSBeanPackage;
    //import com.sapportals.htmlb.enum.TableColumnType;
    import MSSPackage.SortTableModel;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    //import com.sapportals.htmlb.table.TableColumn;
    //import com.sapportals.htmlb.table.TableView;
    //import com.sapportals.htmlb.table.TableViewModel;
    import com.sap.mw.jco.JCO;
    import com.sap.mw.jco.JCO.Table;
    public class PositionOverviewBean {
    //     public DefaultTableViewModel tableModel;
         public SortTableModel tableModel;
         public JCO.Table OrgUnits;
         public String ObjId;
         public String visibleRow;
         public int rowcnt;
         public String sTemp;
         // Get and Set methods for table model
    //     public DefaultTableViewModel gettableModel() { return tableModel; }
    //     public void settableModel(DefaultTableViewModel tableModel)     { this.tableModel = tableModel;     }
         public SortTableModel gettableModel() { return tableModel; }
         public void settableModel(SortTableModel IntableModel)     { this.tableModel = IntableModel;     }     
         public JCO.Table getOrgUnits()     { return OrgUnits; }
         public void setOrgUnits(JCO.Table value) { this.OrgUnits = value; }
         // Get and Set methods for visiblerow
         public String getvisibleRow() {     return visibleRow; }
         public void setvisibleRow(String visibleRow) { this.visibleRow = visibleRow; }     
         public int getRowcnt() { return this.rowcnt; }
         public void setRowcnt(int rowcnt) { this.rowcnt = rowcnt; }
         public String getObjId() { return this.ObjId; }
         public void setObjId(String value) { this.ObjId = value; }     
    Here is the sorting class
    package MSSPackage;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.Vector;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    public class SortTableModel extends DefaultTableViewModel implements Comparator {
         //protected int currCol;
         public int currCol;
         protected Vector ascendCol; // this vector stores the state (ascending or descending) of each column
         protected Integer one = new Integer(1);
         protected Integer minusOne = new Integer(-1);
         public String testing;
         public SortTableModel()
              super();
              ascendCol = new Vector();
         public SortTableModel(Vector vec)
              super(vec);
              ascendCol = new Vector();
         public SortTableModel(Vector vec, Vector vec2, int numberOfColumns)
              super(vec, vec2);
              ascendCol = new Vector();
              setSortOrder(numberOfColumns);
         public int compare (Object v1, Object v2)
              // the comparison is between 2 vectors, each representing a row
              // the comparison is done between 2 objects from the different rows that are in the column that is being sorted
              int ascending = ((Integer)ascendCol.get(currCol)).intValue();
              if (v1 == null && v2 == null)
                   return 0;
              else if (v2 == null)
              { // Define null less than everything.
                   return 1 * ascending;
              else if (v1 == null)
                   return -1 * ascending;
              Object o1 = ((Vector)v1).get(currCol);
              Object o2 = ((Vector)v2).get(currCol);
              // If both values are null, return 0.
              if (o1 == null && o2 == null)
                   return 0;
              else if (o2 == null)
              { // Define null less than everything.
                   return 1 * ascending;
              else if (o1 == null)
                   return -1 * ascending;
              if (o1 instanceof Number && o2 instanceof Number)
                   Number n1 = (Number)o1;
                   double d1 = n1.doubleValue();
                   Number n2 = (Number)o2;
                   double d2 = n2.doubleValue();
                   if (d1 == d2)
                        return 0;
                   else if (d1 > d2)
                        return 1 * ascending;
                   else {
                        return -1 * ascending;
              else if (o1 instanceof Boolean && o2 instanceof Boolean)
                   Boolean bool1 = (Boolean)o1;
                   boolean b1 = bool1.booleanValue();
                   Boolean bool2 = (Boolean)o2;
                   boolean b2 = bool2.booleanValue();
                   if (b1 == b2)
                        return 0;
                   else if (b1)
                        return 1 * ascending;
                   else
                        return -1 * ascending;
              else
                   // default case
                   if (o1 instanceof Comparable && o2 instanceof Comparable)
                        Comparable c1 = (Comparable)o1;
                        Comparable c2 = (Comparable)o2; // superflous cast, no need for it!
                        try
                             return c1.compareTo(c2) * ascending;
                        catch (ClassCastException cce)
                        // forget it... we'll deal with them like 2 normal objects below.
                   String s1 = o1.toString();
                   String s2 = o2.toString();
                   return s1.compareTo(s2) * ascending;
         * This method sorts the rows using Java's Collections class.
         * After sorting, it changes the state of the column -
         * if the column was ascending, its new state is descending, and vice versa.
         public void sort()
              Collections.sort(dataVector, this);          
              //Collections.sort(dataVector);
              Integer val = (Integer)ascendCol.get(currCol);
              ascendCol.remove(currCol);
              if (val.equals(one)) // change the state of the column
                   ascendCol.add(currCol, minusOne);
              else
                   ascendCol.add(currCol, one);
         public void sortByColumn(int column)
              this.currCol = column;
              sort();
         public void setSortOrder(int numberOfColumns)
              for (int i = 0; i < numberOfColumns; i++)
                   ascendCol.add(one);
         public void setTesting(String inStr)
              testing = inStr;
    Any help would be greatly apprciated and rewarded...

    Hi Don,
    be aware that after the method onHeaderClick(Event event) is executed the method doProcessBeforeOutput() is executed as well.
    I look over your code and found the following:
    1) In method onHeaderClick you sort the table model and store the table model in the bean
    2) In method doProcessBeforeOutput() you create a new table model from scratch (in helper method tableViewFormat())and store it in the bean. Thus you overwrite the sorted model.
    I suggest that you move the initial creation of the table model in method doInitialization(). Do not forget to store the created table in the bean. In method doProcessBeforeOutput() you retrieve the table model from the bean instead of creating a new one for every request.
    Best regards,
    Martin

Maybe you are looking for