Application Exceptions for User Feedback

Hi all!
I guess this is a best practice question.
I have a struts-based web app that contains various forms and fields that the user can interact with. When a user is filling out a form, I want to validate that the information s/he is inputting is correct. Now, for basic validation (valid date, string, number, etc) I plan on using javascript. However, there are some instances where I need to allow the user to submit the form, perform some action in my Action servlet and check to see if the data being submitted is correct (for instance, if a user is submitting a item, I would check against my session object, DB, EJB, etc, to see if it already exists). Now if somewhere down the stack of my methods, a piece of the submitted data is found to be invalid, I want to somehow feed back to the user that this is so by displaying it in a status section on my JSP.
From what I've read, it looks like I'm dealing with an application exception. So here's what I've come up with:
//Here's an application exception I created
public class MyAppException extends Exception {
     String errorCode;
     String errorDescription;
     public MyAppException () {
          super();
     public MyAppException (
          String pErrorDescription) {
          errorCode = null;
          errorDescription = pErrorDescription.toUpperCase();
     public MyAppException (
          String pErrorCode,
          String pErrorDescription) {
          errorCode = pErrorCode.toUpperCase();
          errorDescription = pErrorDescription.toUpperCase();
     //Gets...
     public String getErrorCode() {
          return this.errorCode;
     public String getErrorDescription() {
          return this.errorDescription;
//And here's the code that uses it
public class ThisAction extends AdmAction {
public ActionForward perform(
     ActionMapping          pMapping,
     ActionForm               pForm,
     HttpServletRequest pRequest,
     HttpServletResponse pResponse) throws ServletException {
try{
this.doSomething();
catch (MyAppException e){
pRequest.setAttribute("aToUsrMsg", e.getErrorDescription());
catch (Exception e){
e.printStackTrace();
public void doSomething() throws MyAppException, Exception{
try{
SomeClass.someMethod();
catch(MyAppException e){
throw new MyAppException(e.getErrorDescription());
catch(Exception e){
e.printStackTrace();
throw new Exception(e.getMessage());
public static class SomeClass throws MyAppException, Exception{
public static someMethod(
try{
if (SomeConditionExists){
throw new MyAppException("You did something wrong");
catch(Exception e){
throw new Exception("Unexpected:" + e.fillInStackTrace());
The problem instead of the application continuing as it should, reporting the app exception to the user, it halts and prints out the stack trace. Am I approaching this incorrectly?
Thanks for your help!
Leo

try{
if (SomeConditionExists){
throw new MyAppException("You did something wrong"); // (1)
catch(Exception e){ // (2)
throw new Exception("Unexpected:" + e.fillInStackTrace());
}Since MyAppException extends Exception, if MyAppException is thrown in (1), it will be caught in (2) and will later get "converted" to an ordinary Exception.

Similar Messages

  • I need to know the application ID for Speech Feedback.

    I have a problem, the speech feedback icon is in my window after I used it for a while. I went to system preferances and turned speech feedback off. The icon did not disappear. I have tried right clicking for options but nothing happened. I also looked up a converstion in which the questioner was using later software than mine. He had updated his software and the icon was deleted on his desktop. At the end of the conversation between the apple user and the apple attendant the attendant said alternately he could go to the terminal application and type "kill #" the hashtag stands for the item ID. He reffered to an application which I have never seen nore heard of called Process ID. Of course, the user had been using older software than I at the time. I would like to know what the ID for Speech Feedback is so I can delete the icon using terminal. The other recomendations  the attendant reffered to did not work, so again, what is the system ID for the Speech Feedback icon/application?

    Hi, it'll have a different number depending on when it starts, one way to see the PID is to...
    Open Activity Monitor in Applications>Utilities, select All Processes & sort on, sort on Nasame for instance.
    Another to just type top into Terminal...
    QS2002-G5:~ bdaqua$ top
    Processes:  94 total, 4 running, 90 sleeping... 307 threads            17:20:27
    Load Avg:  2.36, 2.27, 2.25     CPU usage:  51.2% user, 9.4% sys, 39.4% idle   
    SharedLibs: num =  190, resident = 73.9M code, 5.50M data, 22.9M LinkEdit
    MemRegions: num = 29182, resident = 1.49G + 22.6M private,  459M shared
    PhysMem:   560M wired,  437M active, 1.85G inactive, 2.82G used, 7.18G free
    VM: 18.4G +  114M   108548(0) pageins, 0(0) pageouts
      PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
    1815 top         29.0%  0:05.32   1    18    22   680K   520K  1.09M  27.0M
    1813 Tri-Backup   0.6%  0:31.47   3   256   309  90.4M+ 40.9M  51.7M+  491M
    1795 Mail         0.0%  1:40.68   6   137   511  83.7M  59.4M   101M   542M
    1794 lookupd      0.0%  0:07.23   2    34    35  1.36M   712K  1.91M  28.1M
    1678 seamonkey-  99.8%  8:08:36  15   196  2049   243M- 79.3M   276M-  668M-
    1673 firefox-bi 100.7%  9:20:19  16   208  3701   561M+  104M   601M+ 1007M+
    1597 writeconfi   0.0%  0:00.09   1    22    27   368K   932K  1.79M  27.3M
    1590 NetCfgTool   0.0%  0:00.02   1    22    24   248K   900K  1.01M  27.2M
    1587 System Pre   0.0%  0:05.96   3   147   391  17.8M  35.4M  26.2M   384M
    1566 Preview      0.0%  0:05.11   4    87   304  6.01M  37.1M  16.1M   371M
    1432 httpd        0.0%  0:00.17   1    12    81   260K  1.81M   876K  28.2M
    1430 Grab         0.0%  0:01.62   3   160   300  4.61M  32.6M  19.4M   369M
    1392 SMART Util   0.0%  0:02.60   3   101   291  6.95M  45.0M  28.1M   403M
    1388 bash         0.0%  0:00.02   1    14    17   204K   968K  1.33M  27.2M
    1387 login        0.0%  0:00.02   1    16    37   124K   560K  1.68M  26.9M
    1385 Terminal     0.5%  0:55.87   3    70   251  2.71M  31.3M  17.3M   363M
    1379 httpd        0.0%  0:00.28   1    12    81   260K  1.81M   876K  28.2M
    1376 Network Ut   0.0%  8:46.44   2    89   265  3.37M  31.6M  5.77M   363M
    1374 httpd        0.0%  0:00.32   1    12    81   280K  1.80M   884K  28.2M
      958 Canvas 9?~D   1.1% 25:47.61   8   107  2184   115M  94.1M   150M   577M
    [1]+  Stopped                 top
    Type control+z to get the prompt back.

  • Error while reading UcdContext [trying to read / set application values for users]

    Hi,
    I am trying to write a program to store user selected values on NW7.3 Portal using "User Content Directory". I can see and read some code snippets on how to set and read the context but I am getting one error after another.
    The error message I am getting is
    "com.sapportals.portal.pcd.gl.PcdGlContext:service:[email protected]entClassLoader@84507ed@alive incompatible with interface com.sapportals.portal.pcd.gl.IPcdContext:sap.com/[email protected]der@f46d103@alive ". Code snippet is as given below at the end of the message.
    1) I tried different ways to have a lookup and always gave message as "look up not found" and for pcd:portal_content came up with above error.
    2) Once I read the UCD context, I would like to store some values based on user selection and store them. User may change the values whenever they like and I will be using the values for other purposes in another application.
    3) Has any one successful in setting and reading UCD Context in NW 7.3. Will it be possible to share such sample code as the code snippets at http://help.sap.com/saphelp_nw73ehp1/helpdata/en/4a/8e1bce28e24dd8abd9f4de05e5587d/content.htm are not much of use unless I am able to read the UCD.
    Thanks for your help!
    Regards,
    Raju
    TestingUCD is my test application and the following is code snippet
    InitialContext initialContext = null;
    IPcdContext pcdCtx;
    Hashtable env = new Hashtable();
    env.put(UCD_INITIAL_CONTEXT_FACTORY, UCD_INITIAL_CONTEXT_FACTORY);
    env.put(Context.SECURITY_PRINCIPAL, request.getUser());
    env.put(Constants.REQUESTED_ASPECT, IPcdAttribute.PERSISTENCY_ASPECT);
    try{
    initialContext = new InitialContext(env);
    //response.write("Before pcdCtx lookup");
    try {
    pcdCtx = (com.sapportals.portal.pcd.gl.PcdGlContext) initialContext.lookup("pcd:portal_content");
    } catch(Exception e){
    response.write("Some problem with lookup" + e.getMessage());

    Hi,
    There are quite few differences in the standard code snippet given by SAP Help on UCD and the once that you put above in the question.
    Below is standard snippet.
    Hashtable<Object, Object> env = new Hashtable<Object, Object>();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    IPcdContext.UCD_INITIAL_CONTEXT_FACTORY);
    env.put(Context.SECURITY_PRINCIPAL, user);
    InitialContext ctx = new InitialContext(env);
    pcdCtx =  (IPcdContext) ctx.lookup("");
    ============================
    Check the ones highlighted in BOLD and compare them in your code. In your code when ur doing initial lookup you are not using the Correct class type cast for the returned lookup object!
    Your code shows as below:
    pcdCtx = (com.sapportals.portal.pcd.gl.PcdGlContext) initialContext.lookup("pcd:portal_content");
    But may be it shd have been something like below:
    pcdCtx = (IPcdContext) initialContext.lookup("pcd:portal_content");
    Pls verify and hopefully this resolves your issues around look up.
    Thanks,
    Swapna Priya.

  • Configure ePortfolio for Crystal Reports 9 Report Application Server for Users to Run Reports

    Post Author: lacc
    CA Forum: Crystal Reports
    Sorry for this basic question but Crystal 9 is no longer supported and I am having trouble finding any documentation about how to configure ePortfolio let alone obtain any help from Crystal support.
    I have a set of .RPT files and would like the simplest and quickest method of distribution to the users with as little coding and fuss as possible.
    We have the ePortfolio page up and running but the users can only view the reports from ePortfolio. They also need to be able to run (refresh) the reports and enter the parameters which have already been built into the .RPT file. Providing access to the deactivated Schedule and History links would also be useful though not a priority unlike access to refresh and enter parameters.
    I usually create reports to run from within an application which I can handover to the application developer so working out how to distribute via this method is pretty new to me.
    I've also had a quick look at the Crystal Reports Viewer XI which appears to be backward compatible for Crystal 9 reports however this also appears to only allow users to view, not generate, reports.
    Any recommendations? Or could you point me in the direction of some documentation that might assist?

    Post Author: lacc
    CA Forum: Crystal Reports
    I think I've worked out that we are actually using ePortfolio Lite. Would anyone be able to confirm if there are any configuration options for ePortfolio Lite? I think we only have the Crystal Reports 9 Advanced version, not Crystal Reports 9 Enterprise. Would this mean that we therefore only have ePortfolio Lite not ePortfolio?

  • Upgrading/re-installing application quits for User

    When I re-instllaed Sorenson Squeeze it would not start "The application unexpectedly quit... etc" No amount of re-installing, optimizing, etc would fix this. The work-around was to create a new User and install it from there. No more problems.
    Then the same thing happened with an upgrade of Motion. "The application unexpectedly quit... etc". Installing it from the apternative User solved the problem, but Motion will only run from that User account.
    Today it happened to a colleague who was upgrading iShell from 4.0r9 to r10. He kept receiving a "Process Error (-600)" and nothing would open. I suggested the new User trick and it worked for him.
    A nice work-around, but there is obviously a problem here. This did not happen in 10.3. Any ideas about what's going on?

    Thanks macjack for a speedy and really helpful reply - it's filed. I've already tried the fonts and permissions, but I just went through your suggestions again with Motion. No joy I'm afraid. Here's the relevant bit of the crash report (I think - it's witchcraft to me)
    Thread 0 Crashed:
    0 com.apple.CoreFoundation 0x907c7af0 CFGetAllocator + 24
    1 com.apple.CoreFoundation 0x907c84ac CFURLCopyFileSystemPath + 28
    2 Ozone 0x011b6df4 +[OZFileSystemLibEntry buildTree] + 532
    3 Ozone 0x01356fb0 -[OZFileBrowserController buildTree] + 96
    4 Ozone 0x0135b920 -[OZLibraryControllerBase viewDidLoad] + 3888
    5 Ozone 0x013569b8 -[OZFileBrowserController viewDidLoad] + 104
    6 Ozone 0x0108d8a0 -[OZPBXModule _viewDidLoad] + 288
    7 Ozone 0x0108d2ec -[OZPBXModule view] + 124
    8 Ozone 0x0117a5f4 -[OZTabbedModule addTabViewItem:module:] + 68
    9 Ozone 0x01146710 -[OZLibraryInspectorController viewDidLoad] + 128
    10 Ozone 0x0108d8a0 -[OZPBXModule _viewDidLoad] + 288
    11 Ozone 0x0108d2ec -[OZPBXModule view] + 124
    12 Ozone 0x0108fda4 -[OZPBXWindowController _installModuleView] + 100
    13 Ozone 0x010905c4 -[OZPBXWindowController initWithModule:] + 68
    14 Ozone 0x0108f760 -[OZPBXModule setWantsModuleWindow:] + 192
    15 Ozone 0x011464c0 +[OZLibraryInspectorController instance] + 96
    16 Ozone 0x0114946c -[OZScreenLayoutManager loadInitialLayout] + 92
    17 Ozone 0x0114964c -[OZScreenLayoutManager loadInitialDocLayout:] + 60
    18 Ozone 0x0114e304 -[OZDocWindowController windowDidLoad] + 852
    19 com.apple.AppKit 0x937f2ca4 -[NSWindowController _windowDidLoad] + 332
    20 com.apple.AppKit 0x937ef678 -[NSWindowController window] + 128
    21 Ozone 0x01083260 -[OZObjCDocument showWindows] + 192
    22 com.apple.AppKit 0x9383bed4 -[NSDocumentController(NSDeprecated) openUntitledDocumentOfType:display:] + 132
    23 Ozone 0x013a9228 -[OZDocumentController openUntitledDocumentOfType:display:] + 232
    24 com.apple.AppKit 0x9379fff0 -[NSApplication sendAction:to:from:] + 108
    25 com.apple.prokit 0x962c5bdc NSProCenterRect + 32000
    26 com.apple.AppKit 0x9379ff24 -[NSControl sendAction:to:] + 96
    27 com.apple.AppKit 0x9379fe04 -[NSCell _sendActionFrom:] + 156
    28 com.apple.AppKit 0x937b9e1c -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1020
    29 com.apple.AppKit 0x937b9a04 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 564
    30 com.apple.prokit 0x962f6850 NSProApplicationLoad + 197300
    31 com.apple.AppKit 0x937b9428 -[NSControl mouseDown:] + 536
    32 com.apple.AppKit 0x9375ac30 -[NSWindow sendEvent:] + 4616
    33 com.apple.prokit 0x962e3858 NSProApplicationLoad + 119484
    34 com.apple.AppKit 0x93703c74 -[NSApplication sendEvent:] + 4172
    35 com.apple.motion 0x00010a58 0x1000 + 64088
    36 com.apple.AppKit 0x936fb0b0 -[NSApplication run] + 508
    37 com.apple.prokit 0x962c6514 NSProApplicationMain + 288
    38 com.apple.motion 0x0000ec24 0x1000 + 56356
    39 com.apple.motion 0x0000d7e8 0x1000 + 51176
    40 dyld 0x8fe01048 dyldstart + 60
    Dual 2.3 PPC G5   Mac OS X (10.4.6)  

  • Request for user feedback: Just-In-Time Advice

    An ongoing debate within LabVIEW R&D needs some more customer input in order to be resolved.
    In LV7.0, we added Just-In-Time Advice dialogs (aka JIT dialogs). Those
    are the small dialogs that you see when, for example, you drop a
    stacked sequence structure and you are informed about the new flat
    sequence structure. See the attached image for an example.  We
    were terrified of introducing something always in your face and getting
    a response like Microsoft's Clippy, but we wanted a way to tell
    customers, particularly upgrade customers, about things that had
    changed and improved ways of using old features. The advice dialogs
    really aren't targeted at new users, since for them, everything is new.
    We need to know if we succeeded and whether or not the design of those
    diialogs should be changed. Only a few customers have ever given
    feedback about the JIT dialogs. That feedback has been fairly off-hand
    such as, "I'm glad that particular dialog was there to help me." But we
    really don't have information about whether the dialogs would be more
    helpful or less if some of their UI aspects changed. The problem we're
    having is that we in LabVIEW R&D wipe our .ini files frequently as
    we test new versions, so the JIT dialogs are always popping up. This
    makes a lot of developers want to change or remove the JIT dialogs
    entirely. So we need a clear picture of whether or not this feature is
    helpful to our users.
    Please think about times you have seen the JIT dialogs and whether you
    were annoyed by them, helped by them, etc, and reply to this message
    with your experiences. Separately, I'll post some of the reasons why we
    made the JIT dialogs behave the way they do. But I'd first like to hear
    some customer feedback with out the biasing, pro or con, that an
    explanation might have.
    --- Stephen Mercer
    -= LabVIEW R&D =-
    Attachments:
    JIT_Advice_Screenshot.png ‏12 KB

    I think it is a good feature, but I'd like to make some suggestions.
    1) When the dialog pops up (like your attachment), it would be nice if I could tell it right then that I don't care about that advice. Right now you have to click on the link and then say you don't want the advice in the future. I think it is that extra step that is really annoying. I think, like most people, my instinct is to just close the dialog. Then next time I run LabVIEW I have to deal with it again. After the 5th time dismissing the damn thing I turn it off.
    2) It would be nice to have an easy way to turn JIT advice off for a particular session. For example, I'm called on to help get new employees up to speed in LabVIEW. When I sit down at their computer to help design/debug things, I would really like to turn off JIT advice but just for my session. I don't want to change the other persons settings.
    3) It would also be nice to be able to turn off JIT advice without going to the options.
    So, I guess what I would like is this. When the JIT advice dialog comes up, instead of only having the link to the advice I'd like to see some a button that will turn off this topic in the future, a button that will turn it off for this session of LabVIEW and a button that will turn JIT off for good (with a verification dialog).
    So, experience programmers with a new install will just turn it off for good the first time it pops up. Experience programmers on someone else's machine can turn it off without messing up the other persons ini file and I can leave it on when LV8 comes out and just dismiss the old advice quickly as it comes up.
    Pat

  • Application object for users to request remote assistance

    Hi
    I want to lock down my users' desktops by changing the Windows shell to Application Explorer but still want my users to be able to request a Remote Assistance session with the list of pre-defined operators.
    I have my policy setup and my users' can go to the Remote Management section of the Adaptive Agent and from there, request a remote assistance session.
    How can I do this without my users' having to go to the properties of the Adaptive Agent?
    Thanks
    rdc

    rgdacosta,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Where is the place for user feedback and beta testing for Playmemories Home and Online?

    I have been a long time user of PMB and PH and want to get involved, I have extensive experience and I am very active with these products, where can I go, there are iussues I want to get to the bottom of and also updates I want to see implemented. Sean. 

    Hi seanoz,
    For further assistance regarding your concern, please contact the Sony offices/Sony representative offices nearest to your place of residence in Asia Pacific region http://www.sony-asia.com/countryselector.html?hpid=countryselector:AsiaPacific. Due to proximity, they are in a better position to respond to your questions or concerns.
    Thanks,
    >Joffrey
    If my post answers your question, please mark it as "Accept as Solution"

  • Looking for Suggestions on granting all users access to an application *except a subset of users*

    This might not be the right forum for this question, but since it is related to an App-V application I figured I would try since this may have come up for some of you.  I am looking for the best way to grant all Domain Users access to an application
    except for Domain Admins.  Using the Full App-V infrastructure, I want to grant access to the App-V UI via User Targeting, but I don't want to allow Domain Admins access.  The reason for this is because when we make updates to provisioned
    server cores (stateless), we login with our Admin accounts to make modifications to the cores, and I would like to reduce the steps that need to be taken at the end to ensure that all AppV applications are removed before sealing up the core. 
    Currently, Domain Admins do not have access to any App-V applications, so this process is fairly clean.  All applications are User Targeted. 
    Packages are cached on a persistent D drive on each server, so the issue is that the registry, programdata, and packageinstallationroot become out of sync if packages are pulled down during core modifications after the core is attached to other servers (hence
    other D drives).  Because of this, Machine Targeting is not an option for this either.
     

    This would be so much easier with a "Configuration Manager" like feature where you could create a collection query to accomplish the same thing.  Are there other tools out there that will do the same thing?

  • AFP Home Directories Working - Except for...

    Hello. I have a test model for a network environment I am preparing to deploy. AFP is working - for the most part - properly and as expected in providing a network home for open directory users.
    However I have three issues I have run into and still can't find the reasoning.
    1) When creating a new home folder in the workgroup manager I get the error below. However it still creates the home and functions - for the most part - properly. This could be connected to any of the below two issues.
    +Error of type Not a known DirStatus (-1) on line 2112 of /SourceCache/WorkgroupManager/WorkgroupManager-319.2.2/Plugins/UserAccounts/Use rAdvancedPluginView.mm+
    2) When viewing the home folder in the finder it doesn't appear that home folder disc quotas are applying correctly. In the guest machine home folder it shows "9 items 26GB Available" at the bottom while the quota is set for 5GB per user.
    3) Write and read (saving files) is working for all applications except for iWeb. About half way through a publish to a folder in iWeb it fails the publish very with a this disk is unwritable error. However it gets many of the files published before it finally fails. Sometimes, but not all times the AFP connection will drop completely and it will come up with an OS "server disconnected" dialogue box.
    Looking at the AFP access log it shows the following hundreds and hundreds of time - probably about 700 or so times repeated. The error log shows no errors. It seems like it is just overloading the server somehow?
    +IP fe80::21c:42ff:fe7d:1638 - - [22/Nov/2008:20:02:52 -0500] "Reconnected User: testuser7" 501 0 0+
    +<Connection> - - [22/Nov/2008:20:02:52 -0500] "Saved for Reconnect User: testuser7" 1227390615 503 0+
    +IP fe80::21c:42ff:fe7d:1638 - - [22/Nov/2008:20:02:52 -0500] "Login testuser7" 0 0 0+
    +** - - [22/Nov/2008:20:02:52 -0500] "<D> testuser7" 89 503 0+
    +IP fe80::21c:42ff:fe7d:1638 - - [22/Nov/2008:20:02:52 -0500] "Reconnected User: testuser7" 503 0 0+
    +<Connection> - - [22/Nov/2008:20:02:53 -0500] "Saved for Reconnect User: testuser7" 1227390615 505 0+
    +IP fe80::21c:42ff:fe7d:1638 - - [22/Nov/2008:20:02:53 -0500] "Login testuser7" 0 0 0+
    +** - - [22/Nov/2008:20:02:53 -0500] "<D> testuser7" 89 505 0+
    +IP fe80::21c:42ff:fe7d:1638 - - [22/Nov/2008:20:02:53 -0500] "Reconnected User: testuser7" 505 0 0+
    +<Connection> - - [22/Nov/2008:20:02:53 -0500] "Saved for Reconnect User: testuser7" 1227390615 507 0+
    +IP fe80::21c:42ff:fe7d:1638 - - [22/Nov/2008:20:02:53 -0500] "Login testuser7" 0 0 0+
    +** - - [22/Nov/2008:20:02:53 -0500] "<D> testuser7" 89 507 0+
    +IP fe80::21c:42ff:fe7d:1638 - - [22/Nov/2008:20:02:53 -0500] "Reconnected User: testuser7" 507 0 0+
    +<Connection> - - [22/Nov/2008:20:02:53 -0500] "Saved for Reconnect User: testuser7" 1227390615 509 0+
    Thanks so incredibly much for any suggestions or ideas.
    ~ Ben

    Parallels Issue. Track at http://forum.parallels.com/showthread.php?p=135585

  • How to apply template page to all pages except for logon page?

    Hi,
    I created a template page with id 0 that contains some copyright and other basic information of my application. Is there a way to apply this to all pages within my application except for the logon page?
    Regards,
    Tamas

    It's possible to make page items or regions conditional on the page not being a page number that you specify.
    Head to your page 0, and look for the relevant item in your conditionals list. Select it and specify your login page number in there and all should be well!
    Ben

  • Deny Acess to Application pages for Read Permissions

    Hi Team
    I want to deny access to few application Pages for  users with Read Permission.
    I have unchecked Permission level "<label for="idspnidViewFormPages">View Application Pages </label>" so i am able to block pages such as
    "Pages/Forms/AllItems.aspx"
    The Application pages i want to block are
    _layouts/1033/selcolor.htm
    _layouts/SmtCommentsDialog.aspx
    _layouts/1033/fontdlg.htm  etc.
    Thanks in advance

    Hi,
    Per my understanding, you might want to forbid users with Read permission accessing some application pages.
    A workaround is that you can apply some JavaScript in the master page to check current user permission and display a warning message or redirect user to other page
    accordingly.
    About
    how to check current user permission using JavaScript:
    http://spdailytips.blogspot.com/2011/09/check-current-user-permission.html
    http://www.codeproject.com/Articles/678653/How-to-check-user-permission-for-the-web-list-or-S
    Add JavaScript into SharePoint master page:
    http://techtrainingnotes.blogspot.com/2012/05/adding-javascript-and-css-to-sharepoint.html
    Redirect user to other page in JavaScript:
    http://www.tutorialspoint.com/javascript/javascript_page_redirect.htm
    Best regards
    Patrick Liang
    TechNet Community Support

  • Exception thrown while enumerating UserProfileManager for user profile

    Hello All,
    We have a SharePoint 2010 Timer Job in which access User Profile Service Application and update user profile properties of some the users. This user profiles is synched with AD. 
    We have following lines of code here:
    SPServiceContext context =
    SPServiceContext.GetContext(site);
    UserProfileManager profileManager =
    new UserProfileManager(context);
    int
    count = profileManager.Count
    //This line works OK
    foreach (UserProfile userProfile
    in profileManager) //This throws exception at first loop
    When we start looping through the
    UserProfileManager instance in above lines of code it throws following exception:
    System.TimeoutException at Microsoft.Office.Server.UserProfiles.ProfileDBCacheServiceClient.GetUserData(UserSearchCriteria searchCriteria)
       at Microsoft.Office.Server.UserProfiles.UserProfileCache.GetBulkUserProfiles(UserProfileManager objManager, String searchColumn, IList searchList, Boolean includeNullsForUnresolvableUsers, Int64& lFailedCount)
       at Microsoft.Office.Server.UserProfiles.UserProfileCache.GetBulkUserProfiles(UserProfileManager objManager, List`1 userIdList, Boolean includeNullsForUnresolvableUsers, Int64& lFailedCount)
       at Microsoft.Office.Server.UserProfiles.ProfileEnumerator`1.PopulateUserProfileQueue(IList userSearchList)
       at Microsoft.Office.Server.UserProfiles.ProfileEnumerator`1.PopulateQueue()
       at Microsoft.Office.Server.UserProfiles.ProfileEnumerator`1.MoveNext()
    One point to note here is that we have almost 50,000 user profiles in total. This exception is thrown intermittently, I mean in the last 10 days it has happened thrice.
    It will be great if someone can help me out on this. Please let me know if any additional  information is required.
    Thanks

    Hi,
    As I understand, you encountered User Profile time out issue.
    First of all, please confirm that related service and service application are at started status on all servers.
    User Profile time out issue might be caused by several reasons, as you said the issue is generated intermittently, there might be networking issue as well. So please check ULS log for related error message.
    Similar issue:
    http://wingleungchan.blogspot.com/2012/11/userprofileapplicationnotavailableexcep.html
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Unhandled Exception Error - Login Failed for User

    Hello,
    I am receiving an error when I run my application stating “Unhandled exception has occurred. If you click continue, the application will ignore the error………..Login failed for MyUser.
    When I click the Continue button the application runs and seems to work properly. This application used to run without receiving the error and I did not make any changes. I have another application that is using basically the exact same code and does not
    receive the error. The only difference is the application is querying a different DB but using the exact same connection string. The error only occurs when I run the exe file created from the build. When I run (debug) the application from within the VS 2013
    IDE I do not receive the error.
    Here are the details to the error message:
    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.Data.OleDb.OleDbException (0x80040E4D): Login failed for user 'jobrunner'.
       at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
       at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
       at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.OleDb.OleDbConnection.Open()
       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
       at LoanOrig_FDIC_Codes.DataSet1TableAdapters.I_LoansTableAdapter.Fill(I_LoansDataTable dataTable) in u:\Visual Studio Projects\LoanOrig_FDIC_Codes\LoanOrig_FDIC_Codes\LoanOrig_FDIC_Codes\DataSet1.Designer.cs:line 1668
       at LoanOrig_FDIC_Codes.Form1.Form1_Load_1(Object sender, EventArgs e) in u:\Visual Studio Projects\LoanOrig_FDIC_Codes\LoanOrig_FDIC_Codes\LoanOrig_FDIC_Codes\Form1.cs:line 152
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    LoanOrig_FDIC_Codes
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///U:/Visual%20Studio%20Projects/LoanOrig_FDIC_Codes/LoanOrig_FDIC_Codes/LoanOrig_FDIC_Codes/bin/Debug/LoanOrig_FDIC_Codes.exe
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    System.Data
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
    System.Data.DataSetExtensions
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
    System.Numerics
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
    System.Transactions
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.
    For example:
    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    I'm not sure what the JIT debugger is but to my knowledge my other apps are not using that. The production username and password are correct in the connection string so I'm not clear why I am receiving this error especially since I'm not receiving the
    error on my other application. I have also attached the code just in case it is needed. Any assistance will be greatly appreciated. Thank you.
    Dave
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using ClosedXML.Excel;
    using DocumentFormat.OpenXml;
    using System.IO;
    namespace LoanOrig_FDIC_Codes
    public partial class Form1 : Form
    SqlCommand sqlCmd;
    SqlDataAdapter sqlDA;
    DataSet sqlDS;
    DataTable sqlDT;
    SqlCommand sqlCmdCnt;
    public Form1()
    InitializeComponent();
    //BEGIN BUTTON LOAD CLICK EVENT
    private void btnLoad_Click(object sender, EventArgs e)
    string sqlCon = "Data Source=FS-12345; Initial Catalog=ExtractGenerator; User ID=MyUser; Password=MyPW";
    //Set the 2 dateTimePickers to today's date
    DateTime @endDate = End_dateTimePicker.Value.Date;
    DateTime @startDate = Start_dateTimePicker.Value.Date;
    //Validate the values of the 2 dateTimePickers
    if (endDate < startDate)
    MessageBox.Show("End Date must be greater than or equal to the Start Date OR Start Date must be less than or equal to the End Date ", "Incorrect Date Selection",MessageBoxButtons.OK,MessageBoxIcon.Error);
    //Reset both dateTimePickers to todays date
    Start_dateTimePicker.Value = DateTime.Today;
    End_dateTimePicker.Value = DateTime.Today;
    return;
    //End of date validation
    string sqlData = @"SELECT AcctNbr,
    CurrAcctStatCD,
    Org,
    MJAcctTypCD,
    MIAcctTypCD,
    NoteOriginalBalance,
    ContractDate,
    FDICCATCD,
    FDICCATDESC,
    PropType,
    PropTypeDesc
    FROM I_Loans
    WHERE CAST(ContractDate AS datetime) BETWEEN @startdate AND @enddate ORDER BY ContractDate";
    SqlConnection connection = new SqlConnection(sqlCon);
    SqlCommand sqlCmd = new SqlCommand(sqlData, connection);
    sqlCmd.Parameters.AddWithValue("@startDate", startDate);
    sqlCmd.Parameters.AddWithValue("@endDate", endDate);
    sqlDS = new DataSet();
    sqlDA = new SqlDataAdapter(sqlCmd); //SqlAdapter acts as a bridge between the DataSet and SQL Server for retrieving the data
    connection.Open();
    sqlDA.SelectCommand = sqlCmd; //SqlAdapter uses the SelectCommand property to get the SQL statement used to retrieve the records from the table
    sqlDA.Fill(sqlDS, "I_Loans"); //SqlAdapter uses the "Fill" method so that the DataSet will match the data in the SQL table
    sqlDT = sqlDS.Tables["I_Loans"];
    //Code section to get record count
    sqlCmdCnt = connection.CreateCommand();
    sqlCmdCnt.CommandText = "SELECT COUNT(AcctNbr) AS myCnt FROM I_Loans WHERE ContractDate BETWEEN @startDate AND @endDate";
    sqlCmdCnt.Parameters.AddWithValue("@startDate", startDate);
    sqlCmdCnt.Parameters.AddWithValue("@endDate", endDate);
    int recCnt = (int)sqlCmdCnt.ExecuteScalar();
    txtRecCnt.Text = recCnt.ToString();
    btnExport.Enabled = true;
    //End of code section for record count
    connection.Close();
    dataGridView1.DataSource = sqlDS.Tables["I_Loans"];
    dataGridView1.ReadOnly = true;
    //Reset both dateTimePickers to todays date
    Start_dateTimePicker.Value = DateTime.Today;
    End_dateTimePicker.Value = DateTime.Today;
    //END BUTTON LOAD CLICK EVENT
    //BEGIN BUTTON EXPORT CLICK EVENT
    private void btnExport_Click(object sender, EventArgs e)
    SaveFileDialog saveFD = new SaveFileDialog();
    { //ClosedXML code to export datagrid result set to Excel
    string dirInfo = Path.GetPathRoot(@"\\FS-03250\users\dyoung\LoanOrig_FDIC_Codes");
    if (Directory.Exists(dirInfo))
    var wb = new XLWorkbook();
    var ws = wb.Worksheets.Add(sqlDT);
    ws.Tables.First().ShowAutoFilter = false;
    //SaveFileDialog saveFD = new SaveFileDialog(); //I moved this variable to the top of the btnExport code block so that the variable will be available thru the entire scope of that code block
    saveFD.Title = "Save As";
    saveFD.Filter = "Excel File (*.xlsx)| *.xlsx";
    saveFD.FileName = "LoanOrig_FDIC_Codes_" + DateTime.Now.ToString("yyyy-MM-dd");
    if (saveFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    Stream stream = saveFD.OpenFile();
    wb.SaveAs(stream);
    stream.Close();
    else if (saveFD.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
    MessageBox.Show("Save file operation has been canceled", "Save As Canceled", MessageBoxButtons.OK, MessageBoxIcon.Stop);
    return;
    //End of ClosedXML code
    MessageBox.Show("File has been exported to " + saveFD.FileName, "File Exported", MessageBoxButtons.OK, MessageBoxIcon.Information);
    //MessageBox.Show("File has been exported to U:\\LoanOrig_FDIC_Codes", "File Exported", MessageBoxButtons.OK, MessageBoxIcon.Information);
    else
    MessageBox.Show("Drive " + saveFD.FileName + " " + "not found, not accessible, or you may have invalid permissions");
    //MessageBox.Show("Drive " + "U:\\Visual Studio Projects\\LoanOrig_FDIC_Codes" + " " + "not found, not accessible, or you may have invalid permissions");
    return;
    //END THE SAVE AS PROCESS
    //END BUTTON EXPORT CLICK EVENT
    private void Form1_Load(object sender, EventArgs e)
    //Set dates to be today's date when the form is openend
    Start_dateTimePicker.Value = DateTime.Today;
    End_dateTimePicker.Value = DateTime.Today;
    private void Form1_Load_1(object sender, EventArgs e)
    // TODO: This line of code loads data into the 'dataSet1.I_Loans' table. You can move, or remove it, as needed.
    this.i_LoansTableAdapter.Fill(this.dataSet1.I_Loans);
    private void iLoansBindingSource_CurrentChanged(object sender, EventArgs e)
    private void btnExit_Click(object sender, EventArgs e)
    this.Close();
    David Young

    In SQL you have a login which allows access to the server but you must also have permissions to access each database that you will use (including Master). So I would verify that your user also has the necessary permissions on the database itself and
    not just the SQL instance. The error you're getting is from SQL saying that the user doesn't have permissions.  If it works for 1 DB but not the other on the same SQL instance then it is likely a missing permission on the DB itself.
    I should note that you have a hard coded conn string in your code but the error is for a different user.  I'm assuming that you simply posted it there for convenience and that you changed the values to obscure the data.  If you are actually getting
    the info from your config file then verify the connection string is correct. Also be sure to not use Integrated Security since it appears that you are using SQL authentication.

  • I am a new mac user and I switch to mac due to the graphics that it brings. I do website in pc and I heard iweb is the best.NOW i heard that iweb will be discontinue. so what is the best application there for website using MAC OSX lion?

    I am a new mac user and I switch to mac due to the graphics that it brings. I do website in pc and I heard iweb is the best.NOW i heard that iweb will be discontinue. so what is the best application there for website using MAC OSX lion?

    It is now confirmed  that iWeb, and iDVD, has been discontinued by Apple. This is evidenced by the fact that new Macs are shipping with iLife 11 installed but without iWeb and iDVD.
    On June 30, 2012 MobileMe will be shutdown. However, iWeb will still continue to work but without the following:
    Features No Longer Available Once MobileMe is Discontinued:
    ◼ Password protection
    ◼ Blog and photo comments
    ◼ Blog search
    ◼ Hit counter
    ◼ MobileMe Gallery
    All of these features can be replaced with 3rd party options.
    I found that if I published my site to a folder on my hard drive and then uploaded with a 3rd party FTP client subscriptions to slideshows and the RSS feed were broken.  If I published directly from iWeb to the FPT server those two features continued to work correctly.
    There's another problem and that's with iWeb's popup slideshows.  Once the MMe servers are no longer online the popup slideshow buttons will not display their images.
    Click to view full size
    However, Roddy McKay and I have figured out a way to modify existing sites with those slideshows and iWeb itself so that those images will display as expected once MobileMe servers are gone.  How to is described in this tutorial: #26 - How to Modify iWeb So Popup Slideshows Will Work After MobileMe is Discontinued.
    It now appears that the iLife suite of applications offered on disc is now a discontinued product and the remaining supported iApps will only be available thru the App Store from now on. However, the iLife 11 boxed version that is still available at the online Apple Store (Store button at the top of the page) and those still on the shelves of retailers will include iWeb and iDVD. Those two apps were listed in small, gray text on the iLife 11 box that I bought.
    Personally, if I didn't already have a copy I would purchase one to have it for reinstallation purposes if ever needed.
    This might be of some interest to you at this time: Life After MobileMe.
    OT

Maybe you are looking for