Problems With url-pattern in a filter-mapping

Hi!
I need to make a filter when the clients call a jsf pages in /pages in my web application, but when i make the filter-mapping like this:
     <filter-mapping>
          <filter-name>sessionFilter</filter-name>
          <url-pattern>/pages/*.jsf</url-pattern>
     </filter-mapping>An exception appears:
SEVERE: Parse error in application web.xml
java.lang.IllegalArgumentException: Invalid <url-pattern> /pages/*.jsf in filter mapping
     at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
     at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
     at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
     at org.apache.commons.digester.Digester.parse(Digester.java:1548)
     at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:263)
     at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:624)
     at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
     at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
     at org.apache.catalina.core.StandardService.start(StandardService.java:480)
     at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)the <url-pattern>/pages/*</url-pattern> not work to me because process all pages, I nedd only *.jsf
Please Help me whit this.

"the <url-pattern>/pages/*</url-pattern> not work to me because process all pages, I nedd only *.jsf"
Yes but in the filter you can get the url from the request.getUrl() and then only process requests that contain .jsf. Simply just pass all other requests along.
Some information on url pattern matching:
http://edocs.bea.com/wls/docs61/webapp/components.html#113049

Similar Messages

  • Problem with URL File download

    Hi every one i am facing a problem with URL File read Technique
    import java.awt.Color;
    import java.io.DataOutputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.net.URL;
    import java.net.URLConnection;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    public class JarDownloader
         boolean isSuccess = false;
         public JarDownloader(String url)
              downloadJar(url);          
         public boolean isDownloadingSuccess()
              return isSuccess;
         private File deleteExistingFile(String filename)
              File jarf = new File(filename);
              if(jarf.exists())
                   jarf.delete();
              return jarf;
         public static void main(String args[]){
              new JarDownloader("url/filename.extension");
         private void downloadJar(String url)
              try
                   URL jarurl = new URL(url);
                   URLConnection urlc = jarurl.openConnection();
                   urlc.setUseCaches(false);
                   urlc.setDefaultUseCaches(false);
                   InputStream inst = urlc.getInputStream();
                   int totlength = urlc.getContentLength();
                   System.out.println("Total length "+totlength);
                   // If the size is less than 10 kb that means the linkis wrong
                   if(totlength<=10*1024)throw new Exception("Wrong Link");
                   JFrame jw =new JFrame("Livehelp-Download");
                   JPanel jp =new JPanel();
                   jp.setLayout(null);
                   JLabel jl = new JLabel("Downloading required file(s)...",JLabel.CENTER);
                   jl.setBounds(10,10,200,50);
                   jp.add(jl);
                   JProgressBar jpbar = new JProgressBar(0,totlength);
                   jpbar.setBorderPainted(true);
                   jpbar.setStringPainted(true);
                   jpbar.setBounds(10,70,200,30);
                   jpbar.setBackground(Color.BLUE);
                   jp.add(jpbar);
                   jw.setContentPane(jp);
                   jw.pack();
                   jw.setResizable(false);
                   jw.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                   jw.setLocationRelativeTo(null);
                   jw.setSize(220,150);
                   jw.setVisible(true);
                   int readlngth=0;
                   int position=0;
                   byte[] readbytes = new byte[totlength];
                   while(totlength-position > 0)
                        readlngth = inst.read(readbytes,position,totlength-position);
                        position+=readlngth;
                        jpbar.setValue(position);
                   File jarf = deleteExistingFile(filename);
                   jarf.createNewFile();
                   //FileWriter fwriter=new FileWriter(jarf,true);
                   FileOutputStream fout = new FileOutputStream(jarf,true);
                   DataOutputStream dout = new DataOutputStream(fout);
                   dout.write(readbytes);
                   dout.flush();
                   dout.close();
                   inst.close();
                   jw.setVisible(false);
                   jw.dispose();
                   isSuccess=true;
              }catch(Exception ex)
                   isSuccess=false;
    }From the above code i received the total length of the PAGE content (i.e here url is a file) when i tried to find the size of that file it return -1.
    please help me

    I think the real problem is that you don't check the return value from read (it's probably less than data.length indicating an incomplete read). Isn't there a readFully somewhere?

  • Problem with a pattern

    I have a problem with a pattern.
    I want to put a patter to validate an e-mail but i don´t find the way to do it

    Hi Veloki,
    You can drag and drop custom "email Adress" object from Custom Object Library. It includes the script for email validation in the validate event of email area.
    // Validate the email address.
    var r = new RegExp("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$"); // Create a new Regular Expression Object.
    // Set the regular expression to look for an email address in general form.
    var result = r.test(this.rawValue); // Test the rawValue of the current object to see
    // if it fits the general form of an email address.
    if (result == true) // If it fits the general form,
    true; // all is well.
    else // Otherwise,
    false; // fail the validation.
    Asiye

  • System-wide Transparent Proxy With URL Patterns

    Internet censorship -where I live- has almost turned web unusable so  I decided to setup a transparent proxy using Tor for my home network.
    Since Tor is so slow -here- proxying all traffic through Tor would slow my connection to a crawl.  Therefore I need a mechanism to selectively proxy the traffic.
    I know a bit of 'iptables' and it looks to me like the solution to my problem.  However there's a trick.  As most of the websites I need to access through Tor (like Google+, Facebook and such) use several IP addresses for their entry points, it's almost impossible for me to add 'iptables' rules for all of those IP addresses.  I need a mechanism to proxy the traffic based on URL patterns.  For example I need to be able to proxy access to '*.facebook.com' through Tor.
    So the question boils down to:  how can I setup a system-wide transparent proxy using URL patterns?
    Any idea/hint is much appreciated.  TIA,
    Bahman
    Last edited by bahman (2012-01-04 07:48:44)

    Use privoxy with socks5 forwarding:
    http://www.privoxy.org/user-manual/config.html#SOCKS
    http://www.privoxy.org/user-manual/acti … F-PATTERNS

  • Problem with childs nodes and automatic key mapping in a Data Object

    Hi experts!
    I'm doing the service order tutorial from the mobile help at [this link|http://help.sap.com/saphelp_nwmobile71/helpdata/en/21/9b5b924c3b434fba4767731794b029/frameset.htm] and I have a problem...
    In the topic "Modeling the Equipment Data Object", says you have to mark the "Automatic Key Mapping" checkbox. So when I had to create a third child node ( the location node ) the system raised an exception with the message "Deselect automatic key mapping flag for more than two-level nodes". I'm trying deselecting the flag and creating the location node, but when I want mark again the automatic key mapping flag, this is disabled.
    What can I do to solve this and create the three child nodes with the flag marked? It's a configuration thing?
    Any help it's very welcome. Thanks in advance.
    Best regards,
    Simon.

    The thing is: Its not allowed to use automatic keymapping if you have more than two levels. This is why the message showed up, and this is why its been disabled.
    What automatic keymapping does: Figures out automatically which child node belongs to which parent (by guessing from the field name and type, which fields in the child correspond to which key fields of the parent).
    On three levels, this becomes more complicated => Its disabled.
    How to do keymapping yourself instead of having the DOE do it automatically: Do 'Explicit keymapping' from each child to its parent. Explicit keymapping is done by clicking on the corresponding menu button in the child node. Here you need to associate child node fields (they need not be key fields of the child, but they are allowed to be that as well) to each of its parent nodes key fields (so that each child can be associated to its parent).
    Cheers

  • Problem with date pattern

    Hi all,
    I have a little maddening problem with oracle.jbo.domain.Date.
    I have a viewObject with an attribute (fechaCompra) type Date and I need the time too so in controlHints I have defined:
    format type: Simple Date
    Format: yyyy-MM-dd 'at' hh:mm:ss
    Right, on runTime now i see ok the data and in the inputDate appears the calendar and the hour .
    But when I take the value of this attribute, to call a void that takes a oracle.jbo.domain.Date type, raises an error when parses the value of the atribute.
    All this doesn't happen when in the view object the controlHints are defined like this:
    format type: Simple Date
    Format: yyyy-MM-dd
    Any idea?
    Thanks in advance,
    Rowan

    hello,
    My guess would be that when you drop your formatted date into the methode the parse function is called from String to date, this work with no time attached.
    But fails with the time attached. I would double check the specific class you pass to each method to be sure they are correct.
    hat you mention parse gives an even bigger hint that you are using the parse function from oracle.jbo.domain.Date, which takes a string.
    This function will fail with your custom patterns.
    //get the value
    String value = .....
    //Not 100% sure if the at needs to be escaped or not
    DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd at hh:mm:ss");
    //Prolly needs a try catch, writing this by hand
    java.util.Date utilDate = sdf.parse(value);
    java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
    oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);
    //pass to your method-Anton

  • Problem with URL:s containing scandinavian characters (Office 2013 / Firefox / SP 2010)

    We are encountering problems with document opening when URL contains scandinavian characters (ä,ö). This issue occurs only with Office 2013 when using Firefox. With IE it works just fine. And Office 2010 works nicely as well.
    Error message: "We can't connect to 'https://intra.../Test powerpoint.pptx' Please make sure you're using the correct web address".
    This issue only occurs when document or document set name contains scandinavian characters. If I rename it, document opens without any problems. 
    Any idea how I could fix this?

    Hi Law, try changing the settings in the library to "open in client application." You should also read the following links for solutions:
    http://sharepoint.stackexchange.com/questions/16938/why-is-word-document-created-from-template-saved-locally-instead-of-to-the-docu
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/ec048a1f-e6cc-481d-8f46-308823568b56/cannot-save-documents-to-sharepoint?forum=sharepointadminprevious
    cameron rautmann

  • Problems with ViaVoice under Leopard, especially key mapping problems

    ViaVoice's behavior has changed considerably under Leopard. First I will discuss the key mapping problem, since I'm eagerly looking for an answer to this problem. At the end of this post, I will voice some of the other problems I've experienced for those who may be interested. The key mapping problem may be specific to the fact that I use a foreign keyboard with a US version of ViaVoice.
    INTRO:
    I have used ViaVoice on my Mac for years, more or less without problems (ViaVoice's bugginess is notorious).
    Those who know ViaVoice will know that one has two general options for dictation. One can dictate into ViaVoice's so-called SpeakPad, which allows special formatting, editing and dictation error correction within the dictated text, or one can dictate into "external" software such as Microsoft Word, in which case ViaVoice just sends a string of characters to that software. SpeakPad appears to make strong use of the operating system's built-in functionality for character formatting, document formatting, etc.
    *MY PROBLEM*
    I have a German keyboard on my PowerBook, yet dictate in US English. When I dictated into SpeakPad under Tiger, all characters appeared correctly. However, when I dictated into Microsoft Word using Tiger, I had to switch the keyboard mapping from German to US to get all characters (that means including the characters that are located at different positions on a German keyboard than they are on a US keyboard such as y, z, apostrophes and parentheses) to appear correctly.
    Under Leopard, things have changed. Now it doesn't matter whether I dictate into SpeakPad or Word; the results are the same and many characters do not appear correctly.
    If set to a German keyboard, y and z appear as expected. To name a few irregularities:
    "(" appears as ")"
    ")" appears as "="
    apostrophes appear as "#" and
    ";" appears as ","
    If set to a US keyboard, y and z are interchanged. "(" and ")" appear as expected. Apostrophes appear as "\" and ";" appears as ","
    By comparison, if typed (as opposed to dictated, as in the examples above) "correctly" (i.e. based on the letters printed on the keyboard) on a German keyboard set to imitate a US keyboard:
    y and z are interchanged
    apostrophes appear as "|"
    "(" appears as "*"
    ")" appears as "(" and
    ";" appears as the symbol for "less than"
    Since I don't have a US keyboard, I can't say how it would behave if set to imitate a German keyboard, i.e. if there's a correlation to the results I get when I dictate.
    Since I was previously able to dictate correctly into SpeakPad by setting the keyboard to "German" and into Word by setting the keyboard to "US," I presume that this is a problem in Leopard, not ViaVoice.
    *OTHER PROBLEMS WITH VIAVOICE UNDER LEOPARD*
    In addition to the aforementioned key mapping problems (that may be specific to those of us with foreign keyboards), ViaVoice appears to have lost considerable functionality in Leopard. I cannot access SpeakPad's Preferences and the correction window. Moreover, the traffic-light like window buttons have disappeared from the VoiceCenter (although they work if you click where they should be). SetupAssistent appears to function.
    I've written to Nuance about these problems, but have little hope that they will invest the time in producing a patch since they haven't released any updates since 2003.

    Thrums1,
    I've never had to "register" ViaVoice after updating the system. I thus suspect you haven't fully followed my above, three-step advice (particularly step 3).
    1) Reinstall ViaVoice from CD.
    2) Update to the latest version (using the patch downloadable from Nuance's website).
    3) Replace the “temp” and “users” folders (in the "ViaVoice" folder at the upper level of your home directory) by a previous copy thereof. When I say previous copy, I mean a copy from when ViaVoice was still working properly, e.g. a copy from when it was running under Tiger.
    As I said, I've gotten ViaVoice to survive several system updates by following the above steps. To my knowledge, the last step is critical since it saves you from having to reconfigure ViaVoice under the new operating system (in this case Leopard). I suspect that ViaVoice is crashing on your system because it's trying to start some module of the SetUpAssistant that is incompatible with Leopard (as many are). If you instead use old copies of the "temp" and "users" folders (from the previous system), then ViaVoice doesn't have to go through the initial "registration" process; ViaVoice doesn't need the SetUpAssistant; and all is (more or less) fine.
    Good luck!
    BTW, to my knowledge, Dictate only runs on Intel Macs. It thus won't run on a G4 iBook, just as it won't run on my PowerBook G4.

  • Problem with condition IF THEN in Message MApping

    Hi,
    We are not getting correct ouput when we use condition IF THEN without else in message Mapping .We are sending data from File to XI to R/3.
    We are using file adapter and IDOC adapter to create customer in R/3.
    In message Mapping we are creating Segment E1KNB1M and E1KNBKM based on condition.
    IF THEN Condition used in mapping is as below
    find the length of Compnaycode with LENGTH function.Pass that value as one of the parameter to function GREATER.Pass second parameter to function GREATER a constant (0).Pass the result to If without else function.If this is true pass Item to IF THEN function and Map the result to E1KNB1M.
    Our mapping is not giving desired output in below scenario:
    Source  XML
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:CustomerMaster_Request_MT xmlns:ns="http://mazdausa.com/sapr3/fi/masterdata/customermaster">
    <Idoc>
    <Header>
      <ID>H</ID>
      <ACCTGRP>M002</ACCTGRP>
      <CUSTNO>R51563</CUSTNO>
      <NAME1>WAYNE MAZDA</NAME1>
        </Header>
    <Item>
      <ID>L</ID>
      <COMPCODE>US10</COMPCODE>
      <BANKKEY>0000326</BANKKEY>
      <BANKCNTRY>US</BANKCNTRY>
      <BANKACCT>05893</BANKACCT>
      </Item>
      </Idoc>
    - <Idoc>
    - <Header>
      <ID>H</ID>
      <ACCTGRP>M002</ACCTGRP>
      <CUSTNO>51563</CUSTNO>
      <NAME1>WAYNE MAZDA</NAME1>
      </Header>
      </Idoc>
    - <Idoc>
    - <Header>
      <ID>H</ID>
      <ACCTGRP>M002</ACCTGRP>
      <CUSTNO>V51563</CUSTNO>
      <NAME1>WAYNE MAZDA</NAME1>
        </Header>
    - <Item>
      <ID>L</ID>
      <COMPCODE>US10</COMPCODE>
      <BANKKEY>000326</BANKKEY>
      <BANKCNTRY>US</BANKCNTRY>
      <BANKACCT>0305893</BANKACCT>
      </Item>
      </Idoc>
      </ns:CustomerMaster_Request_MT>
    Here 3 Idoc are created under ZDEBMAS06.
    First IDOC contain segment E1KNB1M and E1KNBKM as desired because first idoc in Source XML contains Item data.
    Second IDOC contain segment E1KNA1M only as desired because second Idoc in Source XML does not contains item data.
    Third IDOC does not contain Segment E1KNBKM and E1KNB1M which is not a desired output. It should contain these segments as third idoc in source XML have item data.
    But we are getting right output in case we also have Item data under second IDOC in source XML.
    Please let me know where I am doing wrong.
    Thanks.
    Rekha.

    Hi Rekha,
    I am getting the same problem while checking display Queue in message mapping??
    <i><b>Source code has syntax error: java.lang.NoClassDefFoundError: com/sun/tools/javac/Main Exception in thread "main"</b></i>
    Any ideas to solve this problem...
    Thanks,
    Sekhar

  • Design flaw in overloading? Problem with visitor pattern

    I have been trying some implementations of the Visitor pattern in Java and have encountered a problem with overloaded methods in Java. It seems that the caller (client) of a overloaded method decides what implementation of that method is chosen. I find that strange from an OO / encapsulation point of view and it gets me into problems when using Visitor. This code shows my problem:
    // a class with overloaded methods
    public class OverLoadingTest {
         public void print(String s) {
              System.out.println("This looks like a String to me:");
              System.out.println("\"" + s + "\"");
         public void print(Object o) {
              System.out.println("This looks like an Object to me:");
              System.out.println("\"" + o + "\"");
    //a client for that class
    public class OverLoadingTestClient {
         public void test() {
              OverLoadingTest test = new OverLoadingTest();
              Object o1 = "String in an Object reference";
              String s1 = "String in a String reference";
              test.print(o1);
              test.print(s1);
         public static void main(String[] args) {
              new OverLoadingTestClient().test();
    //And the output is:
    This looks like an Object to me:
    "String in an Object reference"
    This looks like a String to me:
    "String in a String reference"
    //The output I would have expeced (wanted):
    This looks like a String to me: //it is a String!
    "String in an Object reference"
    This looks like a String to me:
    "String in a String reference"
    Why is this? Is there a work around?

    The specific method is decided on in compile time and by the client of that method, not the provider. I'd expect the client to just invoke the method and let the privider figure out what implementation to choose. Whatever the client thinks that he is providing as argument types.
    I am implementing a slightly different version compared to http://ootips.org/visitor-pattern.html. I find implementing "v.visit(this);" for every subclass of the Visisted superclass strange. Why an abstract method "accept(Visitor v);" when all subclasses will iplement it in the same way ("v.visit(this);")?
    Daan

  • Problems with URLs in flash launching in IE/XP

    I am unable to launh URL imbedded in html with flash on IE
    under XP. All other platforms work fine.
    sample below;
    onClipEvent (enterFrame) {
    this.text5="<p>Lorem ipsum</p><p>Visit the
    <a href='
    http://www.url.com'
    target='_blank'><u>Link</u></a></p>";
    Scrattching my hair out on this one.
    Michael

    Are you trying to upload from individual Domain.sites files? It looks as if the redirects aren't working, and that's due to problems with index.html files--a common issue in '08 if you are trying to publish individual sites from separate/individual Domain.sites files. Moreover, the site(s) you are looking for may not show up because they may not even be on the server anymore. Domain.sites2 files, (iWeb2.0.1) will erase previously published sites on the iDisk when published.
    Your username url wants to go to a site that doesn't seem to exist anymore on the server: HerringMemorabilia.
    Best thing to do at this point is to have a look at the server itself. Use the Go menu in the Finder to navigate directly to the iDisk sites files, and see what is and what is not actually on the server:
    Go/iDisk/My iDisk/Web/Sites/SitesShouldBeHere/
    Also, while you are there, take a look at the directory that 1.1.2 used:
    Go/iDisk/My iDisk/Web/Sites/iWeb/SitesShouldBeHere/
    Once you see what is there you will be in a better position to diagnose the problem, e.g., issues with index.html files.

  • Programming Web Item. Problem with URL creating

    Hi,
    I am trying to programm a own Web Item.
    I derived from the class CL_RSR_WWW_ITEM_VIEW.
    Everything is worken fine. I just have a problem with
    the creation of links.
    In the WAD there is the very nice way of using SAP BW URLs
    like:
    <SAP_BW_URL cmd="PROCESS_HELP_WINDOW"
    help_service="ZPRINTING"
    item="TABLE_1"
    suppress_repetition_texts=""
    P_PREVIEW_MODE=" ">
    Is the a method or something similar to do the same with abap?
    Greetings
    Mike

    I found  out mayself!
    You just have to use the object CL_RSR_PARAMETER.
    There you can add parameters.
    Then use the method get_url of the object CL_RSR_WWW_PAGE to make a URL string out of it.
    Mike

  • Problems with Factory pattern

    Sorry... I know this topic has been done to death but I still have some questions.
    In my development, I keep encountering a recurring problem that I believe should be solved by the 'factory pattern'. (Note: I'm not a patterns nut so I am only guessing about the correct pattern).
    Here is the problem:
    I develop an abstract base class. I extend the base class with several subclasses. Exterior objects use the instances via a base class reference and I don't want to them to have to know which is the correct subclass or how to create the instance.
    My solution is to make a create(param, param,...) method in the base class and using the param(s) construct the instance something like:static Foo create(int type)
    Foo instance = null;
    String className = "com.myco.foos.DefaultFoo";
    if(CONST_A == type)
      className = "com.myco.foos.FooA";
    else if(CONST_B == type)
      className = "com.myco.foos.FooB";
    {on and on...}
    {using reflection create a new instance from the className String}
    return instance;
    }The obvious problem with the create() method is that it becomes a maintenence point and I don't like the idea of a base class knowing about subclasses.
    Anyone know better a solution? Comments?
    Thanks in advance.

    Yes, that is the Factory pattern you describe. The client programs are going to call your createFoo() method and get back an instance of a subclass of Foo. Typically this pattern is used where there is some external entity that determines what subclass will be returned -- for example a system property -- and the client programs call createFoo() with no arguments. In this case reflection is used to create the instance, and your base class does not need to know anything about any subclasses.
    However, if your client programs can influence the choice of subclass, then they will have to pass some kind of parameter into createFoo(). At this point, createFoo() requires some decision logic that says "create this, or that, depending on the input parameter". And if that parameter is simply a code that enables the client programs to say "Give me a ChocolateFoo instance", then returning "new ChocolateFoo()" is the most straightforward design. But in this case, why can't the client program do that?
    If you don't like the base class having to know about subclasses (and you shouldn't be happy if it does), then you could have a helper class -- FooFactory -- that contains only the static method createFoo(). This class would know about Foo, and about any of its subclasses that it can produce instances of. It's still a maintenance point, no avoiding that, but at least it is off by itself somewhere.

  • Problem with phonenumber pattern

    Hello,
    I've got a problem with my display and validation pattern for my phone numbers.
    In Holland we have two sorts of phone numbers:
    Always 10 numbers, but some regions have a 3 digit area code,
    other regions a 4 digit area code.
    Example:
    012-3456789
    0123-456789
    This is also the way I want my users to enter the data.
    I want to display them as followed:
    012-3456789 --> 012 - 345 67 89
    0123-456789 --> 0123 - 456 789
    My display pattern right now is: text{999 - 999 99 99}|text{9999 - 999 999}
    My edit pattern is: text{999-9999999}|text{9999-999999}
    My validation pattern is: text{999-9999999}|text{9999-999999}
    (With a pop-up message to fill in 10 numbers, area code seperated from the rest by a dash, as in the example)
    The problem is that the validation works fine, but it always transforms the phonenumber to the first option (999 - 999 99 99).
    How can I fix this?
    Greetings and thanks in advance,
    Sterre

    Hi Veloki,
    You can drag and drop custom "email Adress" object from Custom Object Library. It includes the script for email validation in the validate event of email area.
    // Validate the email address.
    var r = new RegExp("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$"); // Create a new Regular Expression Object.
    // Set the regular expression to look for an email address in general form.
    var result = r.test(this.rawValue); // Test the rawValue of the current object to see
    // if it fits the general form of an email address.
    if (result == true) // If it fits the general form,
    true; // all is well.
    else // Otherwise,
    false; // fail the validation.
    Asiye

  • Problems with the File System Repository & User Mapping!

    Hi All
    I am having a problem with a file system repository, and setting up user mapping for that repository.
    I have done the following:
    Created a File System Repository
    Created a Network Path
    Created a System (Including the alias)
    Now when I go into User Administration and select my user the is no user mapped systems to select.
    All this system is doing is connecering to a folder on our File System.
    Any help would be great as this is really frustrating!
    Thanks
    Phil

    I am using EP7 Stack 11 and unfortunately the only options I have are:
    user
    admin
    admin,user
    It is currently set to admin, user and does not seem to work!
    Phil
    Message was edited by:
            Phil Wade

Maybe you are looking for

  • Exclusive Free Goods Based on Value irrespective of the material.

    Dear Community, Our Client wants to provide a stock clearence scheme to his customers that for a billing of INR 100000 or above his customers can make another purchases worth of INR 10000 as free. how can we customize the same in our system. Ram Rast

  • Can't get iTunes to come up at all after upgrade

    I got the message to upgrade Safari, iTunes and Quicktime. I started the download and left. When I came back I got a message to power off the MAC using the power button - it was a transparent box in several languages. I did that and then tried to che

  • Sender JDBC adapter not picking up data

    Hi, I'm using an adpater to poll dta from two tables using the below query: SELECT TPartOrderMaster., (the editor convert the star to bold),   TPartOrderDetail.    FROM TPartOrderMaster INNER JOIN TPartOrderDetail ON TPartOrderMaster.OdrNo = TPartOrd

  • Java claases for mappin

    Hi, i would like to use Java mapping. In saw in the weblog that i need to use the following java packages: - where can i downlod it from ? com.sap.aii.mapping.api.StreamTransformation org.xml.sax.* java.io.* org.xml.sax.helpers.DefaultHandler javax.x

  • Problems getting a licence to redistribute the free versions of Flash & Adobe Reader

    I am trying to register for a licence to distribute the free versions of flash and adobe reader in the school where I work. I have filled in the online application form twice now approximately 2 weeks ago and I have not had any reply back.  I have sp