Problem setting up handlers for Jetty web app

Hello,
I am encountering a problem with setting up the handlers for my web application, what I want is : Having some requests handled by an HTTPServlet with doGet and doPost methods ( how can I load JSP pages from within these methods ? ) and also be able to load static content ( html, JS, CSS )
The way I'm setting it right now, I can only have one or the other, I cannot get both working.
I will explain :
    Server server = new Server(5000);
   // This is the resource handler for JS & CSS
    ResourceHandler resourceHandler = new ResourceHandler();
    resourceHandler.setResourceBase(".");
    resourceHandler.setDirectoriesListed(false);
   // This is the context handler for the HTTPServlet
    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath("/");
    context.addServlet(new ServletHolder(new Main()),"/*");
   // this is the Handler list for both handlers
    HandlerList handlerList = new HandlerList();
    handlerList.setHandlers(new Handler[] { context ,resourceHandler});
     If I add them in this order, all requests will be handled by the "context" and no static resource is loaded
     If I invert the order, the index page page is loaded by the resource handler, which means, If I activate directory listings, it gives me a list of all directories, otherwise it's just a blank page
     I tried working with a WebAppContext to load JSP pages but I still had some problems with which handler should handle which requests
    server.setHandler(handlerList);
    server.start();
    server.join();
Thank you

Lync web app is designed mainly for external partners who are invited to Lync meetings. Thus, the feature cannot be achieved naturally on Lync side. You may post the issue on IIS forum to verify if this can be achieved by setting LWA directory.
Thank you for your understanding.
http://forums.iis.net/
Kent Huang
TechNet Community Support

Similar Messages

  • How can I create an auto-incrementing ID field for a web app?

    I have a web app for a project database. Customers can login and add a new record to the web app. We need it to provide each new project with a unique and sequential number. The BC ID number for each web app item is unique but of course not sequential (and too long). So for example the client would like all project IDs to be 4 digits starting from 1000. Any ideas?
    Thanks in advance!

    Kapowaz,
    Just thinking out loud, I wonder if you could use an Automator action to find the last invoice created and open a new file with a name based on incrementing a part of last file's filename. This would make the filename the same as the invoice number and you would still have to transfer the file's name to the content of the file.
    If I had this need, I think I would create an Invoice Log document. It would be easy to have a table into which you would enter identifying data and date and have the table generate a new invoice number that you could paste into the current invoice document. It would kill two birds with one stone if you need an index of your invoices.
    Jerry

  • Load balancing and HA for office web apps server Lync 2013

    Hi,
        I have 12000 users, 3 FE servers in a pool, 2 edge server in a pool, HA required, IM/presence, A/V, WEb conferencing required. plan to have 2 office web apps server a farm with HA, below are my queries
    1.  which type of load balancing i need....DNS or HLB for office web app servers? if its HLB then is it mandatory?
    2. i have already 2 HLB for FE pool .. one for externa url , one for internal URL...can i use the same HLB for office web app servers ?
    3. one more question regarding EDGE pool load balancing, can i use the same HLB  in EDge pool also that i am using for FE pool?

    Hi,
    1.  which type of load balancing i need....DNS or HLB for office web app servers? if its HLB then is it mandatory?
    WebApps runs on https and you cannot load balance http traffic using DNS load balancing. you need to have a HLB.
    2. i have already 2 HLB for FE pool .. one for externa url , one for internal URL...can i use the same HLB for office web app servers ?
    you can use the same HLB for that
    3. one more question regarding EDGE pool load balancing, can i use the same HLB  in EDge pool also that i am using for FE pool?
    for that one, you probably need a separate HLB.  
    Z-Hire -- Automate Lync User Account creation process ( AD / Exchange / Lync )

  • Falied "Configure OLAP cubes for Project Web App" in Project Server 2013

    Hi
    I'm trying to use the PS2013's capability for generate SSAS Cubes; but after I execute
    the steps described on “Configure OLAP cubes for Project Web App (http://technet.microsoft.com/en-us/library/jj943761.asp)”  the only thing
    achieved is that the state being "Processing…" and the log:
    ===== Initiating OLAP database build process =====
    [10/11/2013 2:48 PM] Cube build request message has been added to the Project Server queue
    When I check the jobs, the one who is associated with the cube creation is on "Succeeded" state but the OLAP database is never created. There is no evidence I think on the Sharepoint log.
    For notice:
    10/11/2013 14:36:24.41 w3wp.exe (0x1A70)                       0x1848 
    Project Server                   Analysis Cube Building                       
    8ida        Information        Standard Information:PSI Entry Point:   Project User: PROJECTSERVER\system  Correlation Id: 0cea4e03-a432-e311-9401-001cc094718e  PWA Site
    URL: http://<server-name>/sites/Walkthroughs  SA Name: Project Server Service Application  PSError: NoError (0) Cube build request was placed on the Project Server Queue.  afaf4b9c-57d6-7004-2661-c95edeacab11
    10/11/2013 14:36:24.43 w3wp.exe (0x1A70)                       0x1848 
    Project Server                   Analysis Cube Building                       
    8swo     Medium               PWA:http://<server-name>/sites/Walkthroughs, ServiceApp:Project Server Service Application,
    User:PROJECTSERVER\system, PSI: [CBS] Status message: Cube build request message has been added to the Project Server queue,
    LogLevelManager Warning-ulsID:0x3873776F has no entities explicitly specified.                afaf4b9c-57d6-7004-2661-c95edeacab11

    Seems like an error occurred during site collection provisioning with the project server features. The provisioning process was interrupted from a system error and doesn't recovered after system restart.
    I just created and provisioned a new site collection and everything is working now.
    ===== Initiating OLAP database build process =====
    [10/16/2013 5:57 PM] Cube build request message has been added to the Project Server queue
    ===== Verifying and running pre-build server event handler =====
    [10/16/2013 5:57 PM] Verifying and running pre-build server event handler
    ===== Determining database and OLAP database structure =====
    [10/16/2013 5:57 PM] Cube build initialization started
    ===== Building database and cubes =====
    [10/16/2013 5:57 PM] Cube build session started
    ===== Verifying and running post-build server event handler =====
    [10/16/2013 5:58 PM] Verifying and running post-build server event handler
    ===== Processing OLAP database =====
    [10/16/2013 5:58 PM] Process OLAP database session started
    ===== Verifying and running post-process server event handler =====
    [10/16/2013 5:59 PM] Verifying and running post-process server event handler
    ===== Process Completed =====
    [10/16/2013 5:59 PM] Cube build request completed successfully.

  • CMS for JSF Web App

    Hello Experts,
    I am new to Java Web Development, just moving from PHP, HTML, CSS and JS.
    Normally, when I build web apps.. I create a simple CMS using PHP and MySQL for the website. So am wondering if there is a CMS for JSF Web Apps.
    I am new, so am open to suggestions and advise.
    Thanks in advance,
    Shina

    There is Flexive. http://www.flexive.org/
    But like Java itself, it is aimed more at enterprise solutions and thus is far more complex than your average PHP CMS "solution".

  • IM+ for Skype web app

    Has anyone used the IM+ for Skype web app yet? I'm curious as to how well it works and actually how it works. I haven't been able to catch any of my friends online at the same time. I don't know if I need to purchase a subscription before I can even talk with skype users on their computer.

    Hey. I'm temporarily living in China and I bought the IM+ $25.00 deal...registered it, and even bought skype credits.
    I, too, tried testing it. I called my skype home phone and the skype home phone did ring but I couldn't hear it ringing through the iphone...it was like the iphone was dead.
    I answered the skype home phone and I also couldn't hear anything in the iphone. So basically the IM+ on the iphone just calls but you never here it calling and you never hear the voice on the other side answering. I tried texting a friend here but he wasn't at his computer so I don't know if that works better.
    Since my iphone is new and I haven't made any calls on it, I thought maybe I had the volume down or something, but doubt that's the case since I couldn't hear my voice on the skype home phone.
    Maybe I jumped the gun in buying the IM+ too soon, but how cool will it be to get calls from people back home in the States or really anywhere else for dirt cheap?
    I also tried the opposite by calling the iphone from my skype home phone. The iphone acknowledged an incoming call with a message on the iphone that told me to wait for the connection, but the calling home skype phone had no sound and no indication it was trying to connect on my iphone. In other words, anyone calling is going to hang up before it connects if it has a delay in connecting and doesn't tell you it's trying to connect.
    I hope they fix this stuff. Using US mobile phones in China costs a small fortune and is really backwards compared to Europe and a lot of other places.
    Has anyone used it successfully yet.

  • Incoming Email not working for one web app, but IS working for others in same farm.

    I have enabled incoming email in a large multi-web application farm running SharePoint 2013 SP1 and the Feb 2015/March 2015 CUs that were pushed down in Windows Updates.  It works just fine for two web applications, but it will not work for one particular
    web application. I see the email land in the /drop folder. If I remove the email address from the library in http://nonworkingapp web
    application and use it on a library in a http://working web application, then the email is processed successfully. Conversely,
    if I take an address from a library in http://working and move it to a library inhttp://nonworkingapp it
    does not work. I've tried multiple site collections on http://nonworkingapp. This rules out any SMTP issues, etc. and means
    the issue is bound to this web application. Permissions are the same between the "non-working" and "working" locations: domain users are members on the site, and the library inherits permissions from the site.  The App Pool and Timer
    Service accounts have rights to the folder and to the library.
    The error in the ULS log is the typical error processing message, but it gives no additional information even though I have enabled Verbose logging.
    The Incoming E-Mail service has completed a batch. The elapsed time was 00:00: 00.0156294. The service processed 2 message(s) in total. Errors occurred processing 2 message(s): Message ID: Message
    ID:
    Typically, you see "alias not found" or some permissions or quota issue here, but this issue is NOT the same as those. In this case NO additional information is provided in ULS.
    Edit: running stsadm.exe -o refreshdms -url http://one/failing/site fixed some similar issues where "Unknown alias" was
    reported even though the list did have an alias (see here:http://blogs.technet.com/b/vinitt/archive/2009/07/15/e-mail-enabled-list-alias-information-is-not-synchronized-between-configuration-database-and-content-database.aspx).
    This did not fix the issue for the case mentioned above.
    What could possibly be the issue preventing incoming email from working on this one web application?

    Thanks for your reply.  Incoming E-Mail was running on all 3 WFE, however I do not think this was the cause.  As noted, _other_ emails send to http://workingapp are working just fine.  I can send two emails - one to a library on http://workingapp
    and another on http://notworkingapp.  The email to http://notworkingapp will sit in the drop folder, while the one to http://workingapp will be processed correctly.  In addition, the ULS log on WFE1 indicates an attempt to process the file fails.
     So clearly, the timer job on WFE1 is running and attempting to process the file.  For kicks, I disabled the service on WFE2 and WFE3, but with no change in the behavior.
    WRT to #1, I have done this already (as noted in the original post).  I can remove an alias from http://workingapp and place it on http://nonworkingapp and it is not processed.  If I return it to http://workingapp it is processed.  In other
    words, I go into Library Settings -> Incoming Email for a working library, and copy the alias, then disable incoming email for that library.  I then go to Library Settings -> Incoming Email for a non-working library, enable incoming email, and paste
    the alias.  Once done, emails sent to the alias are not processed.  I then do the reverse, and it works again.
    On #2, I have already tried multiple libraries on http://nonworkingapp (also as noted in the original post).
    In my environment, incoming email does not work for any library on http://nonworkingapp, but does work for any library on http://workingapp.  Troubleshooting listed above has ruled out any problem with basic mail server configuration or library settings
    - the problem is bound to http://nonworkingapp
    I'm not sure what you mean by "steps to reproduce the issue".  If I knew that, I would probably be able to solve the issue.  The best I could come up with to describe the situation would be:
    Set up SP 2010 in a three-node configuration with multiple web apps
    Enable incoming email and confirm it works
    Migrate to a SP2013 SP1 farm in a three node configuration.
    Enable a new email alias for a library
    Observe that it doesn't work for one web application.
    Obviously, it's pretty unlikely that attempting that in a lab would actually have the same result.

  • Change CSS styles for Acces Web App

    Here's the problem, the #s4-mini-header needs to be set to display:none so the SharePoint header is not shown.  Ideally this would be conditional based on group membership (i.e. Site Owners would see the section, for read only it would be hidden)
    I need to block the "Open in Access" option allows people with read only access to open my database on their local systems.  We're publishing a "member" price list and do not want someone to be able to download the whole list
    and share it with our competitors.
    I've seen quite a few posts on this without solution.  The most common is that "MS is aware of the issue".
    I should be able to hid it in CSS if I can find the file and edit it.  It appears to be using the minimal.master mater page.  SharePoint designer is not allowed to open the site, is this something I need Visual Studio to do?
    I've been given a deadline of today to make the site available for our partners so it looks like they'll get the Options header..
    Thanks for any help!
    VV

    I have found a KLUDGE that solves this particular problem.  Unfortunately it impacts all of the access websites served by that IIS server.
    The problem is that the default.aspx page created when the Access Web App is published has the MasterPageFile value set to point to a file named minimal.master located in \15\TEMPLATE\GGLOBAL.  That file is loaded by the default
    page.  I couldn't find the default.aspx file to edit so I did the next best thing:  I modified the minimal.master file.
    To repeat, the one big gotcha is that changing the file at that location applies the change to ALL access web apps on the IIS server.
    I added style="display:none !important" to the first s4-pr div and the banner was removed.
    A more elegant solution would have been to edit the default.aspx file but I couldn't find it.  If someone comes up with a better way to do this please post it!
    Thanks for all who helped!

  • Need best-practice for Kodo web apps

    Please forgive this question from a JDO newbie if it is already answered
    elsewhere (if so please let me know, I can't find it)...
    We are building an enterprise application consisting of multiple
    cooperating web-apps, one servlet per web app. Following the classic MVC
    pattern (using Struts) we have the servlets operating as controllers that
    concurrently field requests from multiple users. In response to each
    concurrent request the servlets instantiate the corresponding command
    instances to process the requests. The command objects then interact with
    a common shared model implemented as a collection of persistent "model"
    objects and business rules. Finally, the commands then create java beans
    that are sent to JSPs for display to the users.
    No problem thus far - we have successfully used Kodo to implement the
    architecture described above. To date we have used a single persistance
    manager (PM) that is global to the servlets, existing as long as the
    application is running. Although this works, I believe that it won't
    scale for concurrent access by multiple users (correct me if I am wrong)
    since a PM has one and only one database connection. Our concern however
    is regarding persistance managers verses multiple user concurrent access
    to the common model (i.e., one user can update information which is then
    displayed to all other users).
    I believe the answer is in using multiple PMs, but how should the PMs be
    allocated? One per user stored in the user's session? If so, how do
    multiple users share access to the same model instances? My mental model
    is that a PM is like a "sandbox" - objects in one sandbox cannot see
    objects existing in another PM's "sandbox". Is that true?
    I know this is a long winded question. I was hoping to provide enough
    context so someone could suggest a PM utilization that scales well for
    applications like ours.
    Any help/suggestions is GREATLY appreciated!
    Steve

    You can transportable tablespace for the database tier node.
    https://blogs.oracle.com/stevenChan/entry/10gr2_xtts_ebs11i
    https://blogs.oracle.com/stevenChan/entry/call_for_xtts_eap_participants
    For the application tier node, please see:
    https://blogs.oracle.com/stevenChan/entry/migrate_ebs_apptiers_linux
    https://blogs.oracle.com/stevenChan/entry/migrating_oracle_applications_to_new_platforms
    Thanks,
    Hussein

  • Content Search Web Part not work for Office Web Apps

    Hi ,
    In Content Search Web Part word documents are not able to open in browser,but in document library  its working.
    Office Web Apps not work in Content search web part
    Please help me
    Regards
    Sachin

    Below is the display template to open the document in OWA.
    <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> 
    <head>
    <title>AdSpace Picture on top, 3 lines on bottom</title>
    <!--[if gte mso 9]><xml>
    <mso:CustomDocumentProperties>
    <mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
    <mso:ManagedPropertyMapping msdt:dt="string">&#39;Picture URL&#39;{Picture URL}:&#39;PublishingImage;PictureURL;PictureThumbnailURL&#39;,&#39;Link URL&#39;{Link URL}:&#39;Path&#39;,&#39;Line 1&#39;{Line
    1}:&#39;Title&#39;,&#39;Line 2&#39;{Line 2}:&#39;Description&#39;,&#39;Line 3&#39;{Line 3}:&#39;&#39;,&#39;FileExtension&#39;,&#39;SecondaryFileExtension&#39;,&#39;ContentTypeId&#39;,&#39;ServerRedirectedURL&#39;</mso:ManagedPropertyMapping>
    <mso:MasterPageDescription msdt:dt="string">This Item Display Template will show a 304x100 picture of the item on top. The title and the default item description will display to the bottom of the picture with an additional line that is available
    for a custom managed property.</mso:MasterPageDescription>
    <mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId>
    <mso:TargetControlType msdt:dt="string">;#Content Web Parts;#</mso:TargetControlType>
    <mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
    <mso:_dlc_DocId msdt:dt="string">ZRMVMDDDEAE7-1-215</mso:_dlc_DocId>
    <mso:_dlc_DocIdItemGuid msdt:dt="string">583b0835-32ff-4d1c-983f-b6ff4a0ef956</mso:_dlc_DocIdItemGuid>
    <mso:_dlc_DocIdUrl msdt:dt="string">http://sp2013-dev-6:7000/sites/adspace/_layouts/15/DocIdRedir.aspx?ID=ZRMVMDDDEAE7-1-215, ZRMVMDDDEAE7-1-215</mso:_dlc_DocIdUrl>
    <mso:HtmlDesignConversionSucceeded msdt:dt="string">True</mso:HtmlDesignConversionSucceeded>
    <mso:HtmlDesignStatusAndPreview msdt:dt="string">http://sp2013-dev-6:7000/sites/adspace/_catalogs/masterpage/Display Templates/Content Web Parts/Item_PictureOnTop.html, Conversion successful.</mso:HtmlDesignStatusAndPreview>
    </mso:CustomDocumentProperties>
    </xml><![endif]-->
    </head>
    <body>
        <!--
                Warning: Do not try to add HTML to this section. Only the contents of the first <div>
                inside the <body> tag will be used while executing Display Template code. Any HTML that
                you add to this section will NOT become part of your Display Template.
        -->
        <script>
            $includeLanguageScript(this.url, "~sitecollection/_catalogs/masterpage/Display Templates/Language Files/{Locale}/CustomStrings.js");
        </script>
        <!--
            Use the div below to author your Display Template. Here are some things to keep in mind:
            * Surround any JavaScript logic as shown below using a "pound underscore" (#_ ... _#) token
            inside a comment.
            * Use the values assigned to your variables using an "underscore pound equals"
            (_#= ... =#_) token.
        -->
        <div id="Item_PictureOnTop">
    <!--#_
    var useWACUrl = !$isEmptyString(ctx.CurrentItem.ServerRedirectedURL);
            if(ctx.ScriptApplicationManager && ctx.ScriptApplicationManager.states){
                useWACUrl = (useWACUrl && !ctx.ScriptApplicationManager.states.openDocumentsInClient);
            var appAttribs = "";
            if(!useWACUrl)
                if (!$isEmptyString(ctx.CurrentItem.csr_OpenApp)) { appAttribs += "openApp=\"" + $htmlEncode(ctx.CurrentItem.csr_OpenApp) + "\"" }; 
                if (!$isEmptyString(ctx.CurrentItem.csr_OpenControl)) { appAttribs += " openControl=\"" + $htmlEncode(ctx.CurrentItem.csr_OpenControl) + "\"" };
            var url = ctx.CurrentItem.csr_Path;
         if($isEmptyString(url)){
                if(useWACUrl)
                    url = ctx.CurrentItem.ServerRedirectedURL;
                } else {
                    url = ctx.CurrentItem.Path;
    var encodedId = $htmlEncode(ctx.ClientControl.get_nextUniqueId() + "_pictureOnTop_");
    var linkURL = $getItemValue(ctx, "Link URL");
    linkURL.overrideValueRenderer($urlHtmlEncode);
     var iconURL = Srch.ContentBySearch.getIconSourceFromItem(ctx.CurrentItem);
    var line1 = $getItemValue(ctx, "Line 1");
    var setLineHeightRenderer = function(valueInfoObj)
        if(!$isNull(valueInfoObj) && !valueInfoObj.isEmpty)
            if(!$isNull(valueInfoObj.defaultValueRenderer))
                return valueInfoObj.defaultValueRenderer(valueInfoObj);
            else
                return valueInfoObj.toString();
        else
            return "&nbsp;";
    var line2 = $getItemValue(ctx, "Line 2");
    line2.overrideValueRenderer(setLineHeightRenderer);
    var line3 = $getItemValue(ctx, "Line 3");
    line3.overrideValueRenderer(setLineHeightRenderer);
    var pictureURL = $getItemValue(ctx, "Picture URL");
    var pictureId = encodedId + "picture";
    var pictureMarkup = Srch.ContentBySearch.getPictureMarkup(pictureURL, 304, 100, ctx.CurrentItem, "cbs-pictureOnTopImg", line1, pictureId);
    var containerId = encodedId + "container";
    var pictureLinkId = encodedId + "pictureLink";
    var pictureContainerId = encodedId + "pictureContainer";
    var dataContainerId = encodedId + "dataContainer";
    var line1LinkId = encodedId + "line1Link";
    var line1Id = encodedId + "line1";
    var line2Id = encodedId + "line2";
    var line3Id = encodedId + "line3";
     _#-->
            <div class="top-content-box" id="_#= containerId =#_" data-displaytemplate="ItemPictureOnTop">
                <div class="top-content-img" id="_#= pictureContainerId =#_">
                    <a class="cbs-pictureImgLink" href="_#= $urlHtmlEncode(url) =#_" title="_#= $htmlEncode(line1) =#_" target="_blank" id="_#= pictureLinkId =#_">
                        _#= pictureMarkup =#_
                    </a>
                </div>
                    <h3 id="_#= line1Id =#_"><a class="cbs-pictureOnTopLine1Link" target="_blank" href="_#= $urlHtmlEncode(url) =#_" title="_#= $htmlEncode(line1) =#_"
    id="_#= line1LinkId =#_"> _#= line1 =#_ </a></h3>      
                    <span class="content-date" title="_#= $htmlEncode(line2) =#_" id="_#= line2Id =#_"><img class="cbs-Thumbnail" src="_#= $urlHtmlEncode(iconURL) =#_"
    alt="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureId =#_" />_#=line2=#_</span>                
            </div>
        </div>
    </body>
    </html>
    Basically,ctx.CurrentItem.ServerRedirectedURL is calculated by a managed property ServerRedirectedURL which needs to be included in the display template.
    Problem solved.
    Nehal Bhandari,ATL, Nagarro Softwares

  • Distributed sessions for multiple web-apps in a single App. Server (v.8.1)

    I have 3 applications on App. Server 8.1 (running on JDK 1.5)
    App-A handles login
    App-B and App-C are functions that are accessible after login is validated.
    It works fine with App. Server 6.5 (JDK 1.3)
    But the distributed session cannot be shared in App. Server 8.1 (JDK 1.5)
    So App-A handles sign on and stores the user's Login Name on the session.
    App-B and App-C read the user's login name from the session object and grant access to different modules.
    1. Starting App-A and perform login
    2. Starting App-B from App-A (it is linked there)
    3. Starting App-C from App-A (it is linked there)
    In step 1, a new session is created for the user, an attribute ("LoginName") is put in the session - ie. using HttpSession.setAttribute()
    In step 2, the program checks for attribute "LoginName" from the session object - ie. using HttpSession.getAttribute()
    If not found, redirect to login; if found, then continue with App-B
    In step 3, same as in step 2 above.
    It works fine with App. Server 6.5 but problem occurs in step 2 and 3.
    web.xml of App-A, App-B and App-C:
    <i>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>App-A</display-name>
         <distributable/>
    </i>
    sun-web.xml of App-A, App-B and App-C
    <i>
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
    <sun-web-app>
    <session-config>
    <session-manager persistence-type="memory">
    <manager-properties>
    <property name="persistenceFrequency" value="web-method"/>
    </manager-properties>
    <store-properties>
    <property name="persistenceScope" value="session"/>
    </store-properties>
    </session-manager>
    </session-config>
    </i>

    Distributed sessions has nothing to do with different web applications. The concept is about distributing load for the same application between several appserver instances running on the same box(different jvm) or on some other box in the network.
    What you used with iAS 6.5 is not available in 8.1 because sharing sessions between web apps is forbidden by the servlet spec. You should consider repackaging your apps. into a single web app. or using other way of signing/verifying user identity(check Sun Access Manager for example).
    Have a look at this thread as well: http://swforum.sun.com/jive/thread.jspa?threadID=100931

  • Setting a HttpSession on a web app from a client application

    Hi all,
    Using jnlp or applet, i will run a JFrame app which scans an image using the client's scanner and will send this image back to the web app, and continue to use the web app. They do not want to manually upload the image.
    I've completed running the jnlp on the client side and have gotten the image through scanning, my question is..
    How do i set this object as a HttpSession so that back at the web app, my servlet can get this session object?
    Well, I can open a HttpURLConnection to my web server, but how do i set the session object from the client app.
    Thanks.

    I've personally done this before. The solution I used was to send the image from an Applet to a Servlet via ObjectOutputStream and ObjectInputStream. Search for "applet servlet communication"

  • Error while creating farm for Office web apps

    Hello.
    I have error while creating office web apps fars.
    when I enter this code to powershell : New-OfficeWebAppsFarm -InternalURL "http://servername" -AllowHttp -EditingEnabled
    It says this:
    New-OfficeWebAppsFarm : The term 'New-OfficeWebAppsFarm' is not recognized as the name of a cmdlet, function, script
    file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
    and try again.
    At line:1 char:1
    + New-OfficeWebAppsFarm -InternalURL "http://office" -AllowHttp -EditingEnabled
    + ~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (New-OfficeWebAppsFarm:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    so what's the problem?

    That is an error I would expect with the account running the cmdlet not having local administrator rights to the server.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How do I set proxy settings for a Java app behind a corporate server?

    I have the source code of a Download Manager program written in Java. It has to be run within my college network in which we use the "Corporate Client" server to access the internet. The HTTP proxy is 172.16.68.6 and Port number is 3128. How do I define these parameters in my java program so that it can download files from the internet?
    The source code for the program is:
    There are four classes:
    1. DownloadManager.java
    2. Download.java
    3. DownloadTable.java
    4. ProgressRenderer.java
    /*__DownloadManager.java__*/
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    // The Download Manager.
    public class DownloadManager extends JFrame
            implements Observer {
        // Add download text field.
        private JTextField addTextField;
        // Download table's data model.
        private DownloadsTableModel tableModel;
        // Table listing downloads.
        private JTable table;
        // These are the buttons for managing the selected download.
        private JButton pauseButton, resumeButton;
        private JButton cancelButton, clearButton;
        // Currently selected download.
        private Download selectedDownload;
        // Flag for whether or not table selection is being cleared.
        private boolean clearing;
        // Constructor for Download Manager.
        public DownloadManager() {
            // Set application title.
            setTitle("Download Manager");
            // Set window size.
            setSize(640, 480);
            // Handle window closing events.
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    actionExit();
            // Set up file menu.
            JMenuBar menuBar = new JMenuBar();
            JMenu fileMenu = new JMenu("File");
            fileMenu.setMnemonic(KeyEvent.VK_F);
            JMenuItem fileExitMenuItem = new JMenuItem("Exit",
                    KeyEvent.VK_X);
            fileExitMenuItem.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionExit();
            fileMenu.add(fileExitMenuItem);
            menuBar.add(fileMenu);
            setJMenuBar(menuBar);
            // Set up add panel.
            JPanel addPanel = new JPanel();
            addTextField = new JTextField(30);
            addPanel.add(addTextField);
            JButton addButton = new JButton("Add Download");
            addButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionAdd();
            addPanel.add(addButton);
            // Set up Downloads table.
            tableModel = new DownloadsTableModel();
            table = new JTable(tableModel);
            table.getSelectionModel().addListSelectionListener(new
                    ListSelectionListener() {
                public void valueChanged(ListSelectionEvent e) {
                    tableSelectionChanged();
            // Allow only one row at a time to be selected.
            table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            // Set up ProgressBar as renderer for progress column.
            ProgressRenderer renderer = new ProgressRenderer(0, 100);
            renderer.setStringPainted(true); // show progress text
            table.setDefaultRenderer(JProgressBar.class, renderer);
            // Set table's row height large enough to fit JProgressBar.
            table.setRowHeight(
                    (int) renderer.getPreferredSize().getHeight());
            // Set up downloads panel.
            JPanel downloadsPanel = new JPanel();
            downloadsPanel.setBorder(
                    BorderFactory.createTitledBorder("Downloads"));
            downloadsPanel.setLayout(new BorderLayout());
            downloadsPanel.add(new JScrollPane(table),
                    BorderLayout.CENTER);
            // Set up buttons panel.
            JPanel buttonsPanel = new JPanel();
            pauseButton = new JButton("Pause");
            pauseButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionPause();
            pauseButton.setEnabled(false);
            buttonsPanel.add(pauseButton);
            resumeButton = new JButton("Resume");
            resumeButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionResume();
            resumeButton.setEnabled(false);
            buttonsPanel.add(resumeButton);
            cancelButton = new JButton("Cancel");
            cancelButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionCancel();
            cancelButton.setEnabled(false);
            buttonsPanel.add(cancelButton);
            clearButton = new JButton("Clear");
            clearButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionClear();
            clearButton.setEnabled(false);
            buttonsPanel.add(clearButton);
            // Add panels to display.
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(addPanel, BorderLayout.NORTH);
            getContentPane().add(downloadsPanel, BorderLayout.CENTER);
            getContentPane().add(buttonsPanel, BorderLayout.SOUTH);
        // Exit this program.
        private void actionExit() {
            System.exit(0);
        // Add a new download.
        private void actionAdd() {
            URL verifiedUrl = verifyUrl(addTextField.getText());
            if (verifiedUrl != null) {
                tableModel.addDownload(new Download(verifiedUrl));
                addTextField.setText(""); // reset add text field
            } else {
                JOptionPane.showMessageDialog(this,
                        "Invalid Download URL", "Error",
                        JOptionPane.ERROR_MESSAGE);
        // Verify download URL.
        private URL verifyUrl(String url) {
            // Only allow HTTP URLs.
            if (!url.toLowerCase().startsWith("http://"))
                return null;
            // Verify format of URL.
            URL verifiedUrl = null;
            try {
                verifiedUrl = new URL(url);
            } catch (Exception e) {
                return null;
            // Make sure URL specifies a file.
            if (verifiedUrl.getFile().length() < 2)
                return null;
            return verifiedUrl;
        // Called when table row selection changes.
        private void tableSelectionChanged() {
        /* Unregister from receiving notifications
           from the last selected download. */
            if (selectedDownload != null)
                selectedDownload.deleteObserver(DownloadManager.this);
        /* If not in the middle of clearing a download,
           set the selected download and register to
           receive notifications from it. */
            if (!clearing) {
                selectedDownload =
                        tableModel.getDownload(table.getSelectedRow());
                selectedDownload.addObserver(DownloadManager.this);
                updateButtons();
        // Pause the selected download.
        private void actionPause() {
            selectedDownload.pause();
            updateButtons();
        // Resume the selected download.
        private void actionResume() {
            selectedDownload.resume();
            updateButtons();
        // Cancel the selected download.
        private void actionCancel() {
            selectedDownload.cancel();
            updateButtons();
        // Clear the selected download.
        private void actionClear() {
            clearing = true;
            tableModel.clearDownload(table.getSelectedRow());
            clearing = false;
            selectedDownload = null;
            updateButtons();
      /* Update each button's state based off of the
         currently selected download's status. */
        private void updateButtons() {
            if (selectedDownload != null) {
                int status = selectedDownload.getStatus();
                switch (status) {
                    case Download.DOWNLOADING:
                        pauseButton.setEnabled(true);
                        resumeButton.setEnabled(false);
                        cancelButton.setEnabled(true);
                        clearButton.setEnabled(false);
                        break;
                    case Download.PAUSED:
                        pauseButton.setEnabled(false);
                        resumeButton.setEnabled(true);
                        cancelButton.setEnabled(true);
                        clearButton.setEnabled(false);
                        break;
                    case Download.ERROR:
                        pauseButton.setEnabled(false);
                        resumeButton.setEnabled(true);
                        cancelButton.setEnabled(false);
                        clearButton.setEnabled(true);
                        break;
                    default: // COMPLETE or CANCELLED
                        pauseButton.setEnabled(false);
                        resumeButton.setEnabled(false);
                        cancelButton.setEnabled(false);
                        clearButton.setEnabled(true);
            } else {
                // No download is selected in table.
                pauseButton.setEnabled(false);
                resumeButton.setEnabled(false);
                cancelButton.setEnabled(false);
                clearButton.setEnabled(false);
      /* Update is called when a Download notifies its
         observers of any changes. */
        public void update(Observable o, Object arg) {
            // Update buttons if the selected download has changed.
            if (selectedDownload != null && selectedDownload.equals(o))
                updateButtons();
        // Run the Download Manager.
        public static void main(String[] args) {
            DownloadManager manager = new DownloadManager();
            manager.show();
    This example shows how to create a simple download manager in Java. It contains four classes in foru Java source files:
    Download.java: Contains Download class which downloads a file from a URL.
    DownloadManager.java: Contains the main class for download manager application.
    DownloadsTableModel.java: Contains the class which manages the download table's data.
    ProgressRenderer.java: Contains the class which is responsible to render a JProgressBar in a table cell.
    The contents of the listed files are written below.
    /*__Download.java__*/
    import java.io.*;
    import java.net.*;
    import java.util.*;
    // This class downloads a file from a URL.
    class Download extends Observable implements Runnable {
        // Max size of download buffer.
        private static final int MAX_BUFFER_SIZE = 1024;
        // These are the status names.
        public static final String STATUSES[] = {"Downloading",
        "Paused", "Complete", "Cancelled", "Error"};
        // These are the status codes.
        public static final int DOWNLOADING = 0;
        public static final int PAUSED = 1;
        public static final int COMPLETE = 2;
        public static final int CANCELLED = 3;
        public static final int ERROR = 4;
        private URL url; // download URL
        private int size; // size of download in bytes
        private int downloaded; // number of bytes downloaded
        private int status; // current status of download
        // Constructor for Download.
        public Download(URL url) {
            this.url = url;
            size = -1;
            downloaded = 0;
            status = DOWNLOADING;
            // Begin the download.
            download();
        // Get this download's URL.
        public String getUrl() {
            return url.toString();
        // Get this download's size.
        public int getSize() {
            return size;
        // Get this download's progress.
        public float getProgress() {
            return ((float) downloaded / size) * 100;
        // Get this download's status.
        public int getStatus() {
            return status;
        // Pause this download.
        public void pause() {
            status = PAUSED;
            stateChanged();
        // Resume this download.
        public void resume() {
            status = DOWNLOADING;
            stateChanged();
            download();
        // Cancel this download.
        public void cancel() {
            status = CANCELLED;
            stateChanged();
        // Mark this download as having an error.
        private void error() {
            status = ERROR;
            stateChanged();
        // Start or resume downloading.
        private void download() {
            Thread thread = new Thread(this);
            thread.start();
        // Get file name portion of URL.
        private String getFileName(URL url) {
            String fileName = url.getFile();
            return fileName.substring(fileName.lastIndexOf('/') + 1);
        // Download file.
        public void run() {
            RandomAccessFile file = null;
            InputStream stream = null;
            try {
                // Open connection to URL.
                HttpURLConnection connection =
                        (HttpURLConnection) url.openConnection();
                // Specify what portion of file to download.
                connection.setRequestProperty("Range",
                        "bytes=" + downloaded + "-");
                // Connect to server.
                connection.connect();
                // Make sure response code is in the 200 range.
                if (connection.getResponseCode() / 100 != 2) {
                    error();
                // Check for valid content length.
                int contentLength = connection.getContentLength();
                if (contentLength < 1) {
                    error();
          /* Set the size for this download if it
             hasn't been already set. */
                if (size == -1) {
                    size = contentLength;
                    stateChanged();
                // Open file and seek to the end of it.
                file = new RandomAccessFile(getFileName(url), "rw");
                file.seek(downloaded);
                stream = connection.getInputStream();
                while (status == DOWNLOADING) {
            /* Size buffer according to how much of the
               file is left to download. */
                    byte buffer[];
                    if (size - downloaded > MAX_BUFFER_SIZE) {
                        buffer = new byte[MAX_BUFFER_SIZE];
                    } else {
                        buffer = new byte[size - downloaded];
                    // Read from server into buffer.
                    int read = stream.read(buffer);
                    if (read == -1)
                        break;
                    // Write buffer to file.
                    file.write(buffer, 0, read);
                    downloaded += read;
                    stateChanged();
          /* Change status to complete if this point was
             reached because downloading has finished. */
                if (status == DOWNLOADING) {
                    status = COMPLETE;
                    stateChanged();
            } catch (Exception e) {
                error();
            } finally {
                // Close file.
                if (file != null) {
                    try {
                        file.close();
                    } catch (Exception e) {}
                // Close connection to server.
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Exception e) {}
        // Notify observers that this download's status has changed.
        private void stateChanged() {
            setChanged();
            notifyObservers();
    /*__DownloadTableModel.java__*/
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    // This class manages the download table's data.
    class DownloadsTableModel extends AbstractTableModel
            implements Observer {
        // These are the names for the table's columns.
        private static final String[] columnNames = {"URL", "Size",
        "Progress", "Status"};
        // These are the classes for each column's values.
        private static final Class[] columnClasses = {String.class,
        String.class, JProgressBar.class, String.class};
        // The table's list of downloads.
        private ArrayList downloadList = new ArrayList();
        // Add a new download to the table.
        public void addDownload(Download download) {
            // Register to be notified when the download changes.
            download.addObserver(this);
            downloadList.add(download);
            // Fire table row insertion notification to table.
            fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
        // Get a download for the specified row.
        public Download getDownload(int row) {
            return (Download) downloadList.get(row);
        // Remove a download from the list.
        public void clearDownload(int row) {
            downloadList.remove(row);
            // Fire table row deletion notification to table.
            fireTableRowsDeleted(row, row);
        // Get table's column count.
        public int getColumnCount() {
            return columnNames.length;
        // Get a column's name.
        public String getColumnName(int col) {
            return columnNames[col];
        // Get a column's class.
        public Class getColumnClass(int col) {
            return columnClasses[col];
        // Get table's row count.
        public int getRowCount() {
            return downloadList.size();
        // Get value for a specific row and column combination.
        public Object getValueAt(int row, int col) {
            Download download = (Download) downloadList.get(row);
            switch (col) {
                case 0: // URL
                    return download.getUrl();
                case 1: // Size
                    int size = download.getSize();
                    return (size == -1) ? "" : Integer.toString(size);
                case 2: // Progress
                    return new Float(download.getProgress());
                case 3: // Status
                    return Download.STATUSES[download.getStatus()];
            return "";
      /* Update is called when a Download notifies its
         observers of any changes */
        public void update(Observable o, Object arg) {
            int index = downloadList.indexOf(o);
            // Fire table row update notification to table.
            fireTableRowsUpdated(index, index);
    /*__ProgressRenderer.java__*/
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    // This class renders a JProgressBar in a table cell.
    class ProgressRenderer extends JProgressBar
            implements TableCellRenderer {
        // Constructor for ProgressRenderer.
        public ProgressRenderer(int min, int max) {
            super(min, max);
      /* Returns this JProgressBar as the renderer
         for the given table cell. */
        public Component getTableCellRendererComponent(
                JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            // Set JProgressBar's percent complete value.
            setValue((int) ((Float) value).floatValue());
            return this;
    }

    Thank you for the quick reply! But the solution provided by you, it seems, has still not been able to address my issue. I ran the program at command prompt with your said parameters, but the download still gave an error in the App window.
    Also, is there some way of defining these parameters in the source code? I am keen in using NetBeans to run the program.
    Cheers!

  • High Availibity solution for office web app server 2013 for Sharepoint 2013

    I have a scenario with the three nodes SP1 , SP2 and DR-SP with server 2012 standard, each running SharePoint 2013 enterprise, All of three nodes are members of single SharePoint farm that spans two data centers.Primary Data Center have two nodes SP1 , SP2
    and DR data center have one node DR-SP of share point 2013.
    For Office webapp server i have two nodes OWA1, and DR-OWA with server 2012 standard, that spans between two data centers.Primary Data Center have OWA1 and DR data center have one node DR-OWA of office web app server.
    Currently i have configured office web app on  primary data center node OWA .How i can enable high availability of office web app server in case of primary data center outage.Please guide.

    WAC servers on a single farm must be in the same data center. The WAC configuration you've proposed is unsupported. Build a separate WAC farm in the secondary data center and attach it to the SharePoint farm only in the event of a disaster.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Maybe you are looking for

  • How do I prevent iTunes 11 from syncing apps with my devices?

    I want to be able to sync music to my iPad and iPod but I do not want to store their apps on my computer. Since iCloud remembers which apps I own, this is (in my mind) unnecessary. How do I prevent iTunes 11 from syncing my apps? This did not use to

  • External hard drive does not mount after sleep

    I am using a brand new Seagate 2 TB external hard drive for my backup drive.  More often than not, when the computer goes to sleep, the icon for the drive is gone from the desktop when the computer wakes up.  I have to unplug it from the computer and

  • Cannot open apps

    Most of my apps wont open... safari, logic, itunes

  • Oracle  deleting rows from tables starting with the name PQ

    hai friends we are given access rights to delete only tables starting with PQ. HAVING PQ_NUM as primary key for all the PQ tables. totally we have 6 tables. PQ_01,PQ_02, PQ_03,PQ_04,PQ_05,PQ_06. ALL This tables will have one primary key. for example

  • Firewire issues?  Cannot Eject anything firewire..

    So.. anything I connect via firewire, cf card in a firewire reader, external firewire hard drives, ipods.. will not eject.. when I try to eject any of these items I get a message saying "The disk ___ is in use and could not be ejected. Try quitting a