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.

Similar Messages

  • 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

  • Problems with Factory CXmlCtx, xmlnode class on Solaris

    Hi,
    I am using Oracle 10g XDK and Iam facing the following problem in Solaris (this works fine in IBM AIX and HP-UX).
    CXmlCtx* ctxp = new CXmlCtx();
    Factory< CXmlCtx, xmlnode>* fp;
    fp = new Factory< CXmlCtx, xmlnode>( ctxp);
    parser->domparser = fp->createDOMParser(DOMParCXml, NULL);
    The code dumps a core at the 4th line (createDOMParser) function. The code was compiled with SunWSPro compiler /opt/SUNONE8/SUNWspro/bin/cc.
    Any pointers to the resolution of this issue will be appreciated.
    Thanks

    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 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

  • 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

  • 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

  • Intermittent problems with strange patterns on screen

    My new (refurbed) 17in Intel Imac starts up periodically with a strange pattern running at 45 degrees across the entire screen (little multicolor boxes or rectangles) then the screen goes to all blue and freezes with no further activity. I have run the hardware test, reset pram and disk utility with no solutions. It will still boot up perfectly about every 3rd attempt. I'm running 10.4.10. Any help would be greatly appreciated.

    To make sure that this is not software related, set it back to factory settings, without using a backup afterwards, described in this article:
    Use iTunes to restore your iOS device to factory settings - Apple Support
    If the screen has still this pattern, the issue is hardware related and the phone needs to be serviced. In that case it might be enough to let Apple replace the screen.
    Screen repair service pricing
    Repair and replacement costs depend on your iPhone model and your AppleCare product coverage. Apple will run a diagnostic test to determine whether your iPhone has experienced additional damage. If it has, or if it needs other repairs, you may need to pay an out-of-warranty service fee. Accidental damage isn't covered under the Apple One Year Limited Warranty.
    Model
    Screen repair cost
    iPhone 6
    $109
    iPhone 6 Plus, iPhone 5s, iPhone 5c, iPhone 5
    $129
    Plus a $6.95 shipping fee, if required. Fees are in USD and exclude local tax. Pricing is for service through Apple. The final service fee we charge will be determined during testing. Pricing and terms vary for service through an Apple Authorized Service Provider.
    copied from Service Answer Center - iPhone

  • Problem with factory resetting Airport Express

    I am trying to do a hard factory reset my airport express. I want to reset it to the factory default so that I can change the settings so that it connects to my comcast wirless modem. I followed the instructions on the apple support site. I held the reset button will the device was unplugged and then plugged it in while still holding the reset button. I held it until the green light flashed four times. But the stupid thing will not reset at all. Just the same blinking orange light. No green light. And of course, non identifiable on airport admin utility. This is really frustrating. Anyone know how to solve this problem.
    Thanks

    I have the exact problem described by AKAPLG. I've tried EVERYTHING with no good result.
    - My network does NOT show up in AirPort Utility (and even the old Airport Admin Utility)
    - Even after hard reset I can still see the old name of my network but am still unable to join it.
    - I've tried connecting directly with Ethernet to my MacBook Pro, but it is unclear what I'm supposed to do next, the manual doesn't mention this at all. When it's connected I do not see my AX in the AirPort Utility menu when I rescan.
    - The "Factory Reset" described by the booklet that came with the 802.11n device is inconsistent with what I see when I try it. I get a single green blink followed by a long solid yellow (sorry Amber) followed by blinking amber. I never see 4 green blinks, as described.
    This is the worst Apple experience I've ever had. Period. Any more advice please before I take this POS back to the store and trade it for a punch in the ribs or a hot stick shoved in my eye?
    Message was edited by: jpembert

  • Problems with Factory Unlocked iPhone (iMessage)

    Hey guys,
    I have this iPhone 3GS that was previous hacktivated using SAM and unlocked via ultrasn0w for T-Mobile. Everything worked great, I was able to use iMessage and send photos. But I realized I got tired of having to re-unlock everytime an update comes out so I went ahead and got the phone factory unlocked, so I restored it and installed iOS6.
    It booted up for the first time and instantly connected to T-Mobile so I knew the factory unlock was working fine. Push notifications functioned great with no further steps from me. And I really didn't set up iMessage because it was always my assumption that it got enabled by default as long as your Apple ID was entered during the setup.
    So I texted texting via iMessage and it works great, only today I tried to send a message via iMessage and the sending bar gets stuck at the 95% mark and never completes. I can receive pictures via iMessage as my friends sent me one and I got it, and I can even send picture messages over MMS if I do the iBackupBot trick. But I CANT send pics over iMessage and this baffles me.
    I checked Settings > Messages and it says "waiting on activation". Its just been stuck on that (mind you I can still send iMessage texts while it says that) but I can't send pictures.
    And the kicker is, if I attempt to send a picture, it will get stuck, and if I cancel sending that message and try to send a text message after, it will get stuck in the same spot.
    I'm restoring again, and iTunes says "Congratulations, your iPhone has been unlocked" as usual.
    Restored from a backup, and its still waiting on activation. Can't send pics via iMessage but I recieve them....

    Step for step, what I did was Turn off iMessage, then I added $10 to my account (since thats the minimum they allow you to add) then I went ahead and restarted my phone and turned iMessage back on. It said waiting for activation and after about three minutes it activated.
    As for my issue, the actual problem is I'm unable to send MMS over iMessage WHILE im connected to wifi. If I turn wifi off, that disables iMessage and I can send MMS normally over my network
    However I learned just a few moments ago that my iMessage was working 100% while I was on my uni's wifi. The moment I left the campus, and went back to my own wifi at my house, it doesn't work, so I'm assuming its maybe a port forwarding issue?

  • Problem with fill pattern in oracle reports 11g

    Hi all,
    regardless of the fill pattern we use, on paper lines with a fill pattern appear completely black
    no longer using a fill pattern is not an option as we have > 200 reports (migrated from 6i) that use them
    running such a report from the builder choosing paper layout does show the report output correctly on our development PCs
    development PC OS : XP
    WLS 10.3.3 (32 bit)
    Reports builder 11.1.1.3.0
    server : Win 2008 64 bit
    WLS 10.3.3 (64 bit)
    report output is PDF
    the way we work when a user prints a report, the pdf is created on the reports server and then send to the client using webutil and then the report is printed using Adobe Reader 9.3.2
    any ideas ?
    thx in advance
    Kr
    Martin

    anyone ?

  • ASAP PLZ- Having problems with basic pattern input/output

    Hey! I am new to this forum, and I am also new to java =).
    I am writing a program that prompts a user to select 1 pattern out of 5. then the user needs to choose the number of lines he/she wants to display for instace:
    (MENU)
    PATTERN 5
    1
    12
    123
    1234
    USER Selection : Pattern 5
    Choose Number of Lines: 3
    OUTPUT
    Pattern 5
    1
    12
    123
    I have a basic code for a pyramid that deals with leading spaces etc.. but I don't have a clue how to use that method with my program
    MY PROGRAM:
    //Purpose:     Displaying Patterns
    //Input:          User's selection
    //Output:     Messages
    //Author;     Fares
    //Program:     4
    //Date:          9/15/2009
    import java.util.Scanner;
    public class MyPatterns4{
    public static void main(String[] args) {
    // Declarations
    Scanner scan = new Scanner(System.in);
         String outputString;
         int option = 1;
         int lines;
         // Paterns
         String patternOne;
         patternOne = "\n\t Pattern I \n\t 1 \n\t 12 \n\t 123 \n\t 1234 \n\t 12345 \n\t 123456";
         String patternTwo;
         patternTwo= "\n\t Pattern II \n\t 123456 \n\t 12345 \n\t 1234 \n\t 123 \n\t 12 \n\t 1";
         String patternThree;
         patternThree = "\n\t Pattern III \n\t 1 \n\t 21 \n\t 321 \n\t 4321 \n\t 54321 \n\t 654321";
         String patternFour;
         patternFour = "\n\t Pattern IV \n\t 123456 \n\t 12345 \n\t 1234 \n\t 123 \n\t 12 \n\t 1";
         String patternFive;
         patternFive = "\n\t Pattern V \n\t 1 \n\t 12 \n\t 123 \n\t 123456 \n\t 123 \n\t 12";
         // Prompt the user to select a pattern
         outputString = "------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t" +
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t" +
              "5 Display Pattern V\n\t" + "6 Display All Patterns\n\n\n\t" + "0 Quit\n\n\n";
         System.out.println(outputString);
         System.out.print("\tEnter your selection: ");
         option = scan.nextInt();     
         // Keep reading data until the user enters 0
         while (option !=0){     
                   while (option == 6) {
                   outputString = "\nChoose another selections!\n";
                                       System.out.println(patternOne);
                                       System.out.println(patternTwo);
                                       System.out.println(patternThree);
                                       System.out.println(patternFour);
                                       System.out.println(patternFive);
                                       System.out.println(outputString);
              outputString = "--------------------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t" +
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t" +
              "5 Display Pattern V\n\t" + "6 Display All Patterns\n\n\n\t" + "0 Quit\n\n\n";
              System.out.println(outputString);
              System.out.print("\tEnter your selection: ");
              option = scan.nextInt();     
    while (option != 0 && option !=6) {
                   System.out.print("\tEnter number of lines: ");
                   lines = scan.nextInt();     
                   if (lines < 1 || lines > 6) {
    System.out.println("\tYou must enter a number from 1 to 6");
              System.out.print("\tEnter number of lines: ");
                   lines = scan.nextInt();          
              while (lines < 1 || lines > 6) {
    System.out.println("\tYou must enter a number from 1 to 6. The program will now end.");
    System.exit(0);}
                   switch (option) {
                        case 1: // write the code to display Pattern I here
                                       outputString = "\n Choose another selection! \n";
                                       System.out.println(patternOne);
                                       System.out.println(outputString);
                                       break;
                        case 2:      // write the code to display Pattern II here
                                       outputString = "\nChoose another selection!\n";
                                       System.out.println(patternTwo);
                                       System.out.println(outputString);
                                       break;
                        case 3:     // write the code to display Pattern III here
                                       outputString = "\nChoose another selection!\n";
                                       System.out.println(patternThree);          
                                       System.out.println(outputString);
                                       break;
                        case 4:      // write the code to display Pattern IV here
                                       outputString = "\nChoose another selection!\n";
                                       System.out.println(patternFour);
                                       System.out.println(outputString);
                                       break;
                        case 5:      // write the code to display Pattern V here
                                       outputString = "\nChoose another selection!\n";
                                       System.out.println(patternFive);
                                       System.out.println(outputString);
                                       break;
                        case 6: // the code to display all paterns
                                       outputString = "\nChoose another selections!\n";
                                       System.out.println(patternOne);
                                       System.out.println(patternTwo);
                                       System.out.println(patternThree);
                                       System.out.println(patternFour);
                                       System.out.println(patternFive);
                                       System.out.println(outputString);
                                       break;
                        default: outputString = "\nInvalid Selection\n";
                                       System.out.println(outputString);
                                       break;
                   }// end of switch
              outputString = "------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t" +
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t" +
              "5 Display Pattern V\n\t" + "6 Display All Patterns\n\n\n\t" + "0 Quit\n\n\n";
              System.out.println(outputString);
              System.out.print("\tEnter your selection: ");
              option = scan.nextInt();     
    } }// end of while loop
    }// end of main method
    }// end of class

    //Purpose: Displaying Patterns
    //Input: User's selection
    //Output: Messages
    //Author; Fares
    //Program: 4
    //Date: 9/15/2009
    import java.util.Scanner;
    public class MyPatterns4{
    public static void main(String[] args) {
    // Declarations
    Scanner scan = new Scanner(System.in);
    String outputString;
    int option = 1;
    int lines;
    // Paterns
    String patternOne;
    patternOne = "\n\t Pattern I \n\t 1 \n\t 12 \n\t 123 \n\t 1234 \n\t 12345 \n\t 123456";
    String patternTwo;
    patternTwo= "\n\t Pattern II \n\t 123456 \n\t 12345 \n\t 1234 \n\t 123 \n\t 12 \n\t 1";
    String patternThree;
    patternThree = "\n\t Pattern III \n\t 1 \n\t 21 \n\t 321 \n\t 4321 \n\t 54321 \n\t 654321";
    String patternFour;
    patternFour = "\n\t Pattern IV \n\t 123456 \n\t 12345 \n\t 1234 \n\t 123 \n\t 12 \n\t 1";
    String patternFive;
    patternFive = "\n\t Pattern V \n\t 1 \n\t 12 \n\t 123 \n\t 123456 \n\t 123 \n\t 12";
    // Prompt the user to select a pattern
    outputString = "------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t"
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t"
    "5 Display Pattern V\n\t" "6 Display All Patterns\n\n\n\t" "0 Quit\n\n\n";
    System.out.println(outputString);
    System.out.print("\tEnter your selection: ");
    option = scan.nextInt();
    // Keep reading data until the user enters 0
    while (option !=0){
    while (option == 6) {
    outputString = "\nChoose another selections!\n";
    System.out.println(patternOne);
    System.out.println(patternTwo);
    System.out.println(patternThree);
    System.out.println(patternFour);
    System.out.println(patternFive);
    System.out.println(outputString);
    outputString = "--------------------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t"
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t"
    "5 Display Pattern V\n\t" "6 Display All Patterns\n\n\n\t" "0 Quit\n\n\n";
    System.out.println(outputString);
    System.out.print("\tEnter your selection: ");
    option = scan.nextInt();
    while (option != 0 && option !=6) {
    System.out.print("\tEnter number of lines: ");
    lines = scan.nextInt();
    if (lines < 1 || lines > 6) {
    System.out.println("\tYou must enter a number from 1 to 6");
    System.out.print("\tEnter number of lines: ");
    lines = scan.nextInt();
    while (lines < 1 || lines > 6) {
    System.out.println("\tYou must enter a number from 1 to 6. The program will now end.");
    System.exit(0);}
    switch (option) {
    case 1: // write the code to display Pattern I here
    outputString = "\n Choose another selection! \n";
    System.out.println(patternOne);
    System.out.println(outputString);
    break;
    case 2: // write the code to display Pattern II here
    outputString = "\nChoose another selection!\n";
    System.out.println(patternTwo);
    System.out.println(outputString);
    break;
    case 3: // write the code to display Pattern III here
    outputString = "\nChoose another selection!\n";
    System.out.println(patternThree);
    System.out.println(outputString);
    break;
    case 4: // write the code to display Pattern IV here
    outputString = "\nChoose another selection!\n";
    System.out.println(patternFour);
    System.out.println(outputString);
    break;
    case 5: // write the code to display Pattern V here
    outputString = "\nChoose another selection!\n";
    System.out.println(patternFive);
    System.out.println(outputString);
    break;
    case 6: // the code to display all paterns
    outputString = "\nChoose another selections!\n";
    System.out.println(patternOne);
    System.out.println(patternTwo);
    System.out.println(patternThree);
    System.out.println(patternFour);
    System.out.println(patternFive);
    System.out.println(outputString);
    break;
    default: outputString = "\nInvalid Selection\n";
    System.out.println(outputString);
    break;
    }// end of switch
    outputString = "------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t"
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t"
    "5 Display Pattern V\n\t" "6 Display All Patterns\n\n\n\t" "0 Quit\n\n\n";
    System.out.println(outputString);
    System.out.print("\tEnter your selection: ");
    option = scan.nextInt();
    } }// end of while loop
    }// end of main method
    }// end of class

  • Problems with Factory Reset on EPC3925

    After performing a factory reset on my router, I am unable to log into the router in order to set up or change my wireless settings.
    The default admin/password login does not work (I've tried all combinations), and I am only able to login as a guest user (blank username/password), which does not let me change any settings.
    It is also stuck on bridged mode (router page is 192.168.100.1 instead of 192.168.0,1), which I am unable to change both due to both the lack of admin account as well as the fact that the factory resets do not revert it to router/non-bridged mode.
    Any help at all on how to log in and change these settings would be very much appreciated -- thanks!

    Hi CheshireCat and Welcome to the Cisco Home Community.
    The EPC/DPC3925 is an internet service provider (ISP) supported product. In other words you need to contact your ISP or technology reseller that you purchased this from to help you with your question.
    However I did a search and found the DPC3925/EPC3925 manual that may help you: http://manual.upc.ro/pdf/epc_3925.pdf
    The Search Function is your friend.... and Google too.
    How to Secure your Network
    How to Upgrade Routers Firmware
    Setting-Up a Router with DSL Internet Service
    Setting-Up a Router with Cable Internet Service
    How to Hard Reset or 30/30/30 your Router

  • Funny problem with schema pattern regular expression

    I have following element in my schema:
    <xsd:element name="lD">
         <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                   <xsd:pattern value="\d{5,8}" />
              </xsd:restriction>
         </xsd:simpleType>
    </xsd:element>then in the XML, I have:
    <ID>
    123456789
    </ID>funny thing is the schema validates the value successfully. seems the upper bound of 8 the in the regular expression does not have any effect. however, 1234 would fail.
    i looked up the schema prime on W3C, it specifies that {n,m} means at least n and at most m.
    any idea anyone?
    I have using Xerces 1.4.4.
    Thanks

    I tried the example you mentioned and it seemed to
    work for me. It validated both the upper bound and
    the lower bound. Looking at the Manifest file in
    xerces jar, it looks like I have version 2.5.0yes, I know. Xerces 2 works, but Xerces 1 has the above problem. If you get Xerces 1.4.4 from xml.apache.org, you will see the problem.
    I can not use Xerces 2 in our production environment yet.

  • 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

  • Problems with cron pattern in schedule editor

    hi
    I have a transaction that should be executed every 7 seconds. To do this I created a new entry in the schedule editor. Because of the tool to build the cron pattern showed every minute as the most often possible, I looked at the help of xMII.
    There is said, that a pattern of */5 * * * * * would execute every 5 seconds. I changed to */7 * * * * * and saved. The result is, that it is executed every 7 minutes. That is also what I see in the scheduler. Even the pattern * * * * * * that should execute every second according to the help does not what is documented. It executes every minute.
    So the question is, is it possible to execute a transaction every X seconds?
    And the second question, is this a bug in the scheduler or ist the information provided in help wrong?
    Thank you for help.
    Kind regards,
    Timo Bachert

    OK, thank you. Then the help of xMII 12 says wrong (either in german as in english)
    Timo

Maybe you are looking for

  • Different Apple ID's stuck in iPhone and MBP. Also, want to change iTunes account email.

    Hi, I just got my first Macbook Pro (YAY!!), and after fiddling around with it for a couple of days I would like to take advantages of the features of syncing with iCloud in my new hardware and my iPhone 4 (basicly clean up account stuff and enable s

  • Can't hear the microphone

    Hi, I purchased a Speed Link USB microphone (http://www.play.com/PC/PCs/-/676/883/-/5983672/SPEEDLINK-SL-8709-Pure-Voice-Micr ophone-II-USB/Product.html?searchtype=genre). In the system properties, the device is recognised and when I speak into it, t

  • FCE II cannot find hard drive

    I upgraded to FCE2 and used the program w/o incident. I moved some files around and now I can only capture using FCE 1. I am perplexed and only tried to use FCE 1 after trying to repair permissions w/o success. This was an upgrade to FCE2 from FCE1.

  • Brrestore bus error when restore BW Production data

    Hi, I'm trying the restore BW Production data into our QA BW server, but in brrestore it ended with error: bus error (core dumped): BR280I Time stamp 2007-02-21 23.54.48 #FILE..... /oracle/WR1/sapdata1/wr1_25/wr1.data25 #RESTORED. WR1___A0EYES6A0Y Bu

  • What are message tables and their role?How to create and access them ?

    hi, Can any body clarify me about What are messaging tables and their role(use) in DataBase?How to create and access them ? Thanks in advance Gopi