Click here to Skip to main content
15,892,059 members
Home / Discussions / Java
   

Java

 
GeneralRe: how to convert java code to c# code Pin
Paul Conrad27-Jul-12 14:00
professionalPaul Conrad27-Jul-12 14:00 
AnswerRe: how to convert java code to c# code Pin
BobJanova29-Jul-12 22:44
BobJanova29-Jul-12 22:44 
GeneralRe: how to convert java code to c# code Pin
kianfong27-Sep-12 21:26
kianfong27-Sep-12 21:26 
QuestionNEED GOOD JSF VIDEO TUTORIAL Pin
Gaurav Sharma from Bangalore, India24-Jul-12 20:41
Gaurav Sharma from Bangalore, India24-Jul-12 20:41 
AnswerRe: NEED GOOD JSF VIDEO TUTORIAL Pin
TorstenH.24-Jul-12 22:00
TorstenH.24-Jul-12 22:00 
AnswerRe: NEED GOOD JSF VIDEO TUTORIAL Pin
Richard MacCutchan24-Jul-12 22:38
mveRichard MacCutchan24-Jul-12 22:38 
GeneralRe: NEED GOOD JSF VIDEO TUTORIAL Pin
Neo1010129-Jul-12 10:08
Neo1010129-Jul-12 10:08 
QuestionHow can I call doGet method? Pin
Nuha IT24-Jul-12 12:34
Nuha IT24-Jul-12 12:34 
I am beginner to JAVA and I have the following doGet method, and I need to call to from another method

Java
public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException 
    {
        String url = "";
        //if the number is minus n does not exist
        if (Code < 0 ) 
        {
            url = "/Error.jsp";
        }
        //if the number is not included
        else 
        {
            url = "/Error.jsp";
        }
 
        // forward to the view
        RequestDispatcher dispatcher =
                getServletContext().getRequestDispatcher(url);
        dispatcher.forward(request, response);
    }


want to know how to call this method from another method, just like the following.

Java
public int getCode()
    {
        if (stateName.equals("Aden") || stateName.equals("aden") || stateName.equals("ADEN"))
        {
            Code = 01;
            return (Code);
        }
        else if (stateName.equals("Mukalla") || stateName.equals("mukalla") || stateName.equals("MUKALLA"))
        {
            Code = 02;
            return (Code);
        }
        else
        {
          return doGet(request, response);
        }
    }



the line
return doGet(request, response);
I want to know the correct way of calling?
AnswerRe: How can I call doGet method? Pin
Richard MacCutchan24-Jul-12 22:36
mveRichard MacCutchan24-Jul-12 22:36 
AnswerRe: How can I call doGet method? Pin
Andrei Straut25-Jul-12 9:34
Andrei Straut25-Jul-12 9:34 
QuestionHow to parse this XML by using SAX parser, I have no idea about parsing...Plzzz Help Me Pin
Gaurav Sharma from Bangalore, India24-Jul-12 7:30
Gaurav Sharma from Bangalore, India24-Jul-12 7:30 
SuggestionRe: How to parse this XML by using SAX parser, I have no idea about parsing...Plzzz Help Me Pin
Richard MacCutchan24-Jul-12 9:22
mveRichard MacCutchan24-Jul-12 9:22 
GeneralRe: How to parse this XML by using SAX parser, I have no idea about parsing...Plzzz Help Me Pin
Gaurav Sharma from Bangalore, India24-Jul-12 9:38
Gaurav Sharma from Bangalore, India24-Jul-12 9:38 
AnswerRe: How to parse this XML by using SAX parser, I have no idea about parsing...Plzzz Help Me Pin
Richard MacCutchan24-Jul-12 9:26
mveRichard MacCutchan24-Jul-12 9:26 
GeneralRe: How to parse this XML by using SAX parser, I have no idea about parsing...Plzzz Help Me Pin
Gaurav Sharma from Bangalore, India24-Jul-12 9:41
Gaurav Sharma from Bangalore, India24-Jul-12 9:41 
GeneralRe: How to parse this XML by using SAX parser, I have no idea about parsing...Plzzz Help Me Pin
Richard MacCutchan24-Jul-12 9:55
mveRichard MacCutchan24-Jul-12 9:55 
AnswerRe: How to parse this XML by using SAX parser, I have no idea about parsing...Plzzz Help Me Pin
Jair Israel Avilés Eusebio25-Jul-12 9:27
Jair Israel Avilés Eusebio25-Jul-12 9:27 
QuestionHow to parse this XML by using SAX parser Pin
Gaurav Sharma from Bangalore, India24-Jul-12 4:57
Gaurav Sharma from Bangalore, India24-Jul-12 4:57 
AnswerRe: How to parse this XML by using SAX parser Pin
Nagy Vilmos24-Jul-12 5:02
professionalNagy Vilmos24-Jul-12 5:02 
GeneralRe: How to parse this XML by using SAX parser Pin
Gaurav Sharma from Bangalore, India24-Jul-12 5:09
Gaurav Sharma from Bangalore, India24-Jul-12 5:09 
GeneralRe: How to parse this XML by using SAX parser Pin
Nagy Vilmos24-Jul-12 5:12
professionalNagy Vilmos24-Jul-12 5:12 
GeneralThis is XML i got, i don't know how to parse by using SAX. PLZZZ HELP Pin
Gaurav Sharma from Bangalore, India24-Jul-12 5:16
Gaurav Sharma from Bangalore, India24-Jul-12 5:16 
GeneralRe: This is XML i got, i don't know how to parse by using SAX. PLZZZ HELP Pin
Richard MacCutchan24-Jul-12 5:34
mveRichard MacCutchan24-Jul-12 5:34 
GeneralRe:I got this XML, i don't know how to parse by using SAX. PLZZZ HELP, I have no ideaabt Parsing Pin
Gaurav Sharma from Bangalore, India24-Jul-12 5:39
Gaurav Sharma from Bangalore, India24-Jul-12 5:39 
GeneralRe:I got this XML, i don't know how to parse by using SAX. PLZZZ HELP, I have no ideaabt Parsing Pin
Richard MacCutchan24-Jul-12 6:31
mveRichard MacCutchan24-Jul-12 6:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.