Building a function in JSP ???

Hi, im fairly new to JSP...
Well, you will see by this question...
Anyway...
Im trying to built a function to test for NULL String.
Here is wath i got :
checkForNullParam( strLang, strMailID ); // The Call of the function
function checkForNullParam( strLang, strMailID ); // The Function itself
     return false;
Of course, i did not put anything in the function since i was not able to compile...
If someone can help...
Thanks

Yep, i notice that vivek_sundar !
Just like C++
I will get it...
Its weird to pass from Microsoft to Sun...
Anyway...
Now that this is working...
I got another problem..
Ah ha !!!
I will post that tomorrow...
From now on... Im out of here !
See ya everyone !

Similar Messages

  • How to build dynamic menus using JSP==Urgent==Please Help me

    Hello,
    I have exhausted searching on internet to find a book
    which tells how to build Dynmic menus in JSP.I dont want
    to use DHTML as this becomes complex as the menu categories
    are built using data from database.Is there any workaround in
    java to do this without DHTML or atleast sample code.
    can somebody help me in this regard.
    Thanks
    Jack

    Hello a.s.kumar,
    I would be greatful if you could send me the sample code.
    [email protected]
    we can't let MM Flash run away with the show can we. Javascript can do a decent job, but the underlying menu data is static.
    Cheers, Darren

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

  • Access session variable in Java Function in JSP

    Hi Experts !!
    I am developing an application using STRUTS MVC...
    Very sorry if u have problem understanding my question, i ll try to improve... and sorry if i can't post codes here
    Basic question is ....
    I want to open a word document on pageLoad of JSP, the word document is not a single document, there is a form in which there is a "name" and "template" whenever user clicks on a button there is one action attached to it which creates a copy of that template in a different folder.. on the next page OnLoad i want to open that particular document. for that i have created a variable and also have set in the session, just want to access it in the below code.
    I have a formbean in which i have a variable, the scope is session, that variable i have put it in session also. but i want to access that variable in a "java function" in JSP so that "onLoad" page that function should work.
    JSP---
    <script type="text/javascript">
    function openDocument() {
    var w = new ActiveXObject("Word.Application");
    var docText;
    var obj;
    var a;
    if (w != null) {
    w.Visible = true;
    obj = w.Documents.Open(I HAVE TO ACCESS THAT VARIABLE HERE);
    </script>
    FORMBEAN----
    public class CreateSOWFormBean extends ActionForm {
    private String workflowName;
    private String comment;
    private String sowTemplate;
    private String sowFileCreated;
    public String getSowFileCreated() {
    return sowFileCreated;
    public void setSowFileCreated(String sowFileCreated) {
    this.sowFileCreated = sowFileCreated;
    sowFileCreated is the variable that i have accessed in session and that value i have to pass in that function in JSP....
    I am aware of something like
    obj = w.Documents.Open(<%'sowFileCreated'%>);
    but i m not sure how to write....
    Plz help.....

    If you're working under a framework like struts you should definitely be using JSTL tags rather than scriptlet code to access variables within the page. With JSTL code <% codes can be almost entirely avoided.
    To transfer a value from a Servlet to a JSP don't use a session variable, use a request attribute. Session variables should only be used when values have to survive from one transaction to another.
    You can write something like:
    obj = w.Documents.open('<c:out value="${openURL}"/>');in the Javascript portion of your JSP.
    Just beware of potential problems with quotes. The coresponding code in the Servlet would be like:
    request.setAttribute("openURL", openUrl);

  • How to avoid Build Array function inside a For (while) Loop?

    Hi there,
    I have a simple question about how to avoid using Build Array function inside the loop. Now I want to remove the Build Array funtion inside the loop to improve the performance (To get better memory management). Any idea how to do that?
    Thanks a lot!
    Warmest regards,
    Chong

    It's been my experience that using the auto-indexing to build an array
    on a For loop is just as good as initializing and replacing elements.
    The For loop knows before it runs how many iterations it has to run and
    can allocate the array ahead of time.
    You're better off initializing and replacing when using a While loop
    because it does not know how many iterations it will run and can't
    pre-allocate the array ahead of time.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • How to realize print function in JSP

    How to realize print function in JSP? I know use Javascript:window.print() can print,but it will print whole page,it don't fit me;Another method is to write JSP into Excel and then print it in Excel,but it don't fit me too,because it don't print directly. Anybody know how to print it directly?

    Many websites offer a "printer friendly" version of a certain page. That IMO is the only way to solve your problem, next to using CSS to use a different style for printer output. Here is a tutorial that covers this:
    http://www.alistapart.com/stories/goingtoprint/

  • How to write printing function using JSP?

    dear all,
    i want to add a printing function in my project but i do not know how to do it? could anyone teach me how to do it?
    thanks
    eric

    salut eric,
    you can do it this way :
    1 - create a html link in your code to this javascript
    function : (I am using Struts, but you can write it in
    pure html
    <html:link href="#bodyStart"
    onclick="openWindowForPrinting()"
    titleKey="msg.status.print">      <bean:message
    key='app.print' />
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html:link>
    >
    >
    2 - here is the javascript function : it open a window
    with the "print.jsp" page.
    function openWindowForPrinting(){
    window.open('/your_project/pages/common/print.jsp','',
    'left=150, top=150 , status=no, directories=no,
    toolbar=no, menubar=yes, location=no, scrollbars=yes,
    resizable=yes, dependant=yes');
    3 : here is the print.jsp page : You have only to
    create a session variable called
    "currentBodyRelativeLocation", which content the
    relative URL to the page you want to print (for
    example, the boby of the current page).
    <%@ taglib uri='/WEB-INF/tlds/perso.tld'
    prefix='perso' %>
    <html>
    <head>
    <perso:csslink page='${cssRelativeLocation}' />
    </head>
    <body onload="var SymTmpWinOpen = window.open; window.open = SymWinOpen; printPage();; window.open = SymTmpWinOpen;">
    <body>
    <jsp:include page="${currentBodyRelativeLocation}"/>
    </body>
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html>
    <script language='javascript'>
    function printPage(){
    window.print();
    window.close();
    </script>
    hai,
    i'm not very understand how is your code work. when i write html code, do i need to mind about this code: "msg.status.print" ? what is this code mean?
    i have too much question on this thing. would you mind to be further explain to me? or is it any reference for me to refer? i'm really new to write printing function on JSP.
    i never write this function before. i'm feel so lost.....:(
    thanks again
    eric

  • Passing values to JavaBean function using jsp scriplet

    Hi,
    I have a JavaBean funtion that is SaveData(parameters)
    which save the values from HTML form.
    Now i want a code for pass the values from HTML form to SaveData() function using jsp scriptlet.
    I used the code
    <jsp:useBean id="JDBC" class="bean.JDBCBean" scope="application"></jsp:useBean>
    <%=JDBC.saveData(phonenumber,manufacturer,model,email,country,newsletter)%>
    Here
    JDBCBean -> Bean Name
    phonenumber,manufacturer,model,email,country,newsletter ->HTML form's text values
    But it didnt work properly.
    Anyone help me to correct this.

    Hi,
    i have the same code like above
    I have to pass the parameters with form name under the following code.
    <jsp:useBean id="JDBC" class="bean.JDBCBean" scope="application"></jsp:useBean>
    <%=JDBC.saveData(registration.phonenumber.value,id_type.value,id_style.value,registration.email.value,registration.scountry.value,player_type.values)%>
    Here
    registration -> HTML form name
    But i got the error for
    package registration does not exist
    out.print(JDBC.saveData(registration.phonenumber.value,id_type.value,id_style.value,registration.email.value,registration.scountry.value,player_type.values));
    How to i correct this?
    Anyone help me......

  • Queuename cannot be build with function(while creating invoice VF01) IDoc

    Hi all,
    I had a problem while posting an invoice with reference to the delivery document . we had configured partner profile with INVOIC02 and extension for that. and maintained Transfer IDocs immediately. queue processing is enabled . before implementing OSS notes it is working fine. after implementing these notes we are getting update termination message and the invoice document is not getting saved.  the notes are 0001019483 and 0001280898 .
    After implementing notes rule is enabled and in that rule we had given IDOC_QUEUE_SUS_MM. and we had done cofig for that in we85.
    the message is like this.
    Update was terminated
    System ID....   R1Q
    Client.......   100
    User.....   ABOSE
    Transaction..   VF01
    Update key...   4DF9276AC53F16E6E100800082180442
    Generated....   16.06.2011, 12:43:49
    Completed....   16.06.2011, 12:43:50
    Error Info...   B1 519: Queuename cannot be build with function:
    Please helpme out
    Thanks & regards
    sreehari p

    Dear Reddy,
    This may due to two reasons
    1.Itemcategory settings
    2.Copy control settings at item level between your sales document type and your billing type ZF3.So fallow these steps you can rectify the issue.
    -->You go to the VOV7 transaction then select item category ZAPT TAP then go in to the details of that here you can find the field Billing Relevance maintain this field "B" or "C" if you are doing order related billing.
    -->Go to VTFA transaction click on change icon (Top Left Corner)then select your billing type ZF3 and sales order type then click on the item here you select the itemcategory ZAPT TAP then go in to the details screen here you need to enter the copying requirement routines.
    Standard routine is 002-item/order related in the Copying requirements field.
    Standard routine is 001-Inv.split (sample) in the Data VBRK/VBRP field.
    And also check the Header level copy control settings
    Maintain these settings then try
    I hope it will help you
    Regards,
    Murali.

  • How to run the recursive function in jsp

    hi, can any body tell me how to run
    rrays.sort(files);
    for (int i = 0, n = files.length; i < n; i++) {
    for (int indent = 0; indent < indentLevel; indent++) {
    System.out.print(" ");
    if (files.toString().endsWith(".jsp"))
    System.out.println(files[i].toString());
    if (files[i].isDirectory()) {
    listPath(files[i]);
    indentLevel--;
    this code in jsp
    thanks in advance

    Why are you writing scriptlets and functions in JSPs?
    Functions are supposed to be written in the Java Application layer.
    JSPs are best suited only to display information.
    Also why are you using Scriptlets insted of JSTL ?
    Anyway, if you want to write in JSPs only , here's how to write a function in them: http://forum.java.sun.com/thread.jspa?threadID=496577&messageID=2341986 you can figure out the rest.

  • Why not build same function in Itunes as Spotify offers ..? I Would definitely buy me access on site.. :-)

    why not build same function in Itunes as Spotify offers ..? I Would definitely buy me access on site.. :-)

    Spotify has a completely different legal and contractual structure, oriented towards subscription services. You never, ever, own the music you hear on Spotify, and both artists and labels are compensated at a minuscule fraction of the quantity they receive when you buy music from the iTunes store. It is not clear that the Spotify model will remain sustainable over time, as artists/labels have little incentive other than promotion to post their work there.
    Apple would have to determine that such an arrangement was worthwhile to them (and you, and all the other parties) before they went that route. Technically, it is not hard for them.

  • Equivalent function of JSP:include or @include?

    Could someone please let me know how I can include html pages in a java servlet page? I am looking for similar function as JSP include. A simple example would be must appreciated. Thanks!

    Thanks for you reply. Actually, what I want to do is to import/include a static html page to my java servlet page. I do not want to use JSP because all the pages created were sevlet. I found out a way that using getServletcontext.getResource to read in the html page and print it out from the servlet. Just wondering that if there is a better way to do this?

  • Exit a function in JSP

    How can I exit a function in JSp
    my code is
    <%! String Dothis(int level)
    if(level==2)
    //exit the function
    else
    %>
    How can I exit this function .....
    Break label does not work...as I am not able to declare a label
    Pl...guide me
    smita

    Looking into ur code ,,,, U can do it like the following in addition to solutions posted above ( Exception and return)
    <%! String Dothis(int level)
    if(level != 2)
    %>
    Thanks
    Sampath ...

  • Same as PHP Functionality In JSP, HOw?

    Hi,
    I am a developer having experiance in PHP with Oracle, I recently have projects to develop in JSP, I want know does JSP also have the Variable in Variable functioanlity in as it's available in PHP?
    In php I stored my variable name in a PHP variable as
    $Asif='My Name is Asif';
    $a='Asif';
    Echo "Here we can get the result of variable Asif using variable a: ".$$a;
    in the above by using $$ it understand the inside value is the actual variable name whose value is to print..
    I need same functionality in JSP.....
    if Any one can help...
    THanks in Advance.
    Asif

    The same rule applies for textboxes as for checkboxes with the same name - indeed for any components accessed in the dom via javascript.
    If there is only one element of that name, it is accessed directly.
    If there is more than one element of that name, it reveals them as an array.
    so document.testForm.a_date would return an array of input fiels
    document.testForm.a_date[0], document.testForm.a_date[1] ... document.testForm.a_date[n]
    However the order of submission of parameters is NOT guarunteed, which is why people normally DON'T have fields in this manner - because you can't know for certain that a_date[1] matches with b_date[1] at the server end.
    The common practice is to give each field a unique name (numbered).

  • EMAIL FUNCTION USING JSP

    HOW CAN I WRITE A EMAIL FUNCTION USING JSP
    WHICH HAVE FORWARD, REPLY, REPLAY ALL, AND ADDRESS BOOK LIKE YAHOO EMAIL FUNCTION
    HOW CAN I WRITE IT?

    I meant you would face a considerable challenge trying to write
    public static void main(String[] arg) { } with your Caps-Lock key stuck.
    You would not even be able to escape your way out of it with
    \u0070\u0075\u0062\u006C\u0069\u0063 \u0073\u0074\u0061\u0074\u0069\u0063 \u0076\u006F\u0069\u0064 \u006D\u0061\u0069\u006E(S\u0074\u0072\u0069\u006E\u0067[] \u0061\u0072\u0067) { } as the "\u" escape sequence also contains a lowercase character.

Maybe you are looking for

  • Error in accessing to Crystal Report CMC

    Hi, i have installed all 3 CDs of Crystal Report Server, but when i try to access the CMC via .NET/Java Administration Launchpad, the internet browser shows an Error Report, it states that "The Requested resource (businessobjects/enterprise11/adminla

  • Outlook 2013 Category view not updating after Exchange 2010 SP3 RU3

    After updating to Exchange 2010 SP3 RU3 last night, users who use categories view in Outlook 2013 are complaining that the view does not update. The alert is received in the notification area and the unread message count next to Inbox updates appropr

  • ITunes erasing music?

    Argh. Okay, this is driving me crazy. I purchased an iPod Touch (2nd generation) back in August; similarly, I finally downloaded the 2.1 software update, and followed with a song purchase from the iTunes Store. For some odd reason, iTunes isn't savin

  • Mavericks upgrade disables external drive software

    How do I restore driver software which has been marked as "Incopatible Software" and disabled by Mavericks upgrade? The drivers enable me to back up, using Time Machine, my contents to Western Digital MyBook.

  • Set field as key

    Hello, I have a doubt. I need to change a field of a table and add it to the key. What i need to know is what kind of impact will that have and the table and if the data on that specific field will be maintained. Thank you, Nuno