Checking textbox through java class which is called  in jsp

I have created a text box in html and if the string entered by user is a alphabet it will not show any message ,else it should display a error message..These checking validations of textbox is done in java and called in jsp;
a.html
<font size="4">Enter the search keyword:</font><input type="text" name="key" ><br>
and also submit button is there which goes to main.jsp
main.jsp
<%@page import="gaveshan.checking;"%>
<%
checking ch=new checking();
String trans=request.getParameter("key");
out.println(ch.ParseClean(trans));
session.setAttribute( "trans", trans );
%>
checking.java
package gaveshan;
import java.awt.event.*;
public class checking
{  public String ParseClean(String str)
if(str.length()==100||str.length()==0)
return "Enter String Properly";
for(int i=0;i<str.length();i++)
if(!(str.charAt(i)>65&&str.charAt(i)<122))
return "Enter String Properly";
it is not givng any message when user enters the input in textbox
it is not showing any error

Using javascript.
var lwr = 'abcdefghijklmnopqrstuvwxyz';
var upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
function isValid(parm) {
for (i=0; i<parm.length; i++) {
if (val.indexOf(parm.charAt(i),0) == -1) return false;
return true;
}- vignesh

Similar Messages

  • PI 7.1 Access to Dynamic Configuration through Java Class

    My Current scenario involves IDCO -> FILE communications in PI 7.1 using XSL where the file name is dynamic.
    I have attempted calling a Java Class from XSL with the use SAPXMLTOOL kit option set in the adaptor and it works but I need to be able to call the transform method
    public void transform(TransformationInput arg0, TransformationOutput arg1)
    from XSL so I can access the message and update the File Name via Dynamic Configuration.
    Whilst I can call a static class with in the object I can not call transform with the correct arguments (arg0, arg1). I need access to arg0 (payload) to set/figure out the filename. I can calculate the filename in XSL and pass it to the Java but in a static method it is useless as it need to access the arg0 which is a object and obviously non-static context.
    Is this possible ? How do I get access to Dynamic Configuration from XSL through Java in 7.1 ?
    I have successfully called a static method but that is no help.
    Thanks in advance.

    Suraj,
       Unfortunately you link isnt operational but thankyou anyway, I have managed to call as Java class as per my original post, but a static method does not allow me to get a handle to the Dynamic Configuration Variables in the message.
    It seems importing the 7.0 LIBS may be an option and Im not entirely sure I have that option.
    It certainly isnt possible to use the JDK5 XML implementation to even call a static method on an Java OBJ from XSL (obviously the USE SAPXMLTOOLKIT option is there for a reason).
    I think and again I could be wrong but direct access via XSLT..
    LINK:http://help.sap.com/saphelp_nwpi71/helpdata/EN/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    Is what Im looking for, I shall report back success or failure but the doco seems to fit the bill. Im not sure why I wanted to instatiate a sperate Java class when it can all exist in the XSLT.

  • Creating stubs for a java class which implements ejbobject and ejbHome

    Hi,
    I am using the weblogic rmic utility to generate WLStub of a class which implements
    EJBHome and EJBObject. The stubs are being generated with the name...WLStub261b2l255i2g1h1324e2u702w6fn1t.class
    rather than with the name_WLStub as it should be and as the server wants it to
    be when I try to bind this object using JNDI.
    I appreciate your help.
    Thanks,
    Kamps

    Have you tried the -nomanglednames option as from:
    Usage: java weblogic.rmic [options] <classes>...
    where options include:
    -help Print this help message.
    -version Print version information.
    -d <dir> Target (top-level) directory for compilation.
    -nontransactional Suspends the transaction before making the
    RMI call and resumes after
    -verbosemethods Instruments proxies to print debug info to
    std err.
    -descriptor <example> Associates or creates a descriptor for each
    remote class.
    -nomanglednames Don't mangle the names of the stubs and
    skeletons.
    kamps wrote:
    >
    Hi,
    I am using the weblogic rmic utility to generate WLStub of a class which implements
    EJBHome and EJBObject. The stubs are being generated with the name...WLStub261b2l255i2g1h1324e2u702w6fn1t.class
    rather than with the name_WLStub as it should be and as the server wants it to
    be when I try to bind this object using JNDI.
    I appreciate your help.
    Thanks,
    Kamps

  • Are there any Java classes  which generates UI Maps based on UI Hints

    Hi,
    I would like to know how UI Hints work and how UI Maps are generated based on UI Hints.
    Are there any java classes behind?

    Can someone help me on how to do this?

  • Problem accessing servlet from java class which uses Basic Authentication

    "Hi,
    I am using weblogic 6.1 server. I am calling a servlet file from a class file using HttpURLConnection. This is the code below.
              String theUsername="B1A1Z1T2";
              String thePassword="hlladmin";
              String urlString="http://rsnetserver:113/hll/servlet/CallSSRUpload";
              String userPassword = theUsername ":" thePassword;
              String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
              try
                   URL url = new URL (urlString);
                   HttpURLConnection uc=(HttpURLConnection)url.openConnection();
                   int it = 0;
                   while ((it = encoding.indexOf('\n')) != -1
                        || (it = encoding.indexOf('\r')) != -1) {
                             encoding = encoding.substring(0, it)
                             encoding.substring(it 1);
                   uc.setRequestProperty("Authorization","BASIC " encoding);
                   uc.setRequestProperty("SOAPAction", url.toString());
                   System.out.println(uc.getResponseCode());
                   System.out.println(uc.getResponseMessage());
              catch(Exception io)
                   io.printStackTrace();
                   System.out.println("error message........" io.getMessage());     
    In web.xml I have d

    Hello,
    Could you post the stack trace?
    Thanks,
    Bruce
    Vijay Babu wrote:
    >
    "Hi,
    I am using weblogic 6.1 server. I am calling a servlet file from a class file using HttpURLConnection. This is the code below.
    String theUsername="B1A1Z1T2";
    String thePassword="hlladmin";
    String urlString="http://rsnetserver:113/hll/servlet/CallSSRUpload";
    String userPassword = theUsername ":" thePassword;
    String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
    try
    URL url = new URL (urlString);
    HttpURLConnection uc=(HttpURLConnection)url.openConnection();
    int it = 0;
    while ((it = encoding.indexOf('\n')) != -1
    || (it = encoding.indexOf('\r')) != -1) {
    encoding = encoding.substring(0, it)
    encoding.substring(it 1);
    uc.setRequestProperty("Authorization","BASIC " encoding);
    uc.setRequestProperty("SOAPAction", url.toString());
    System.out.println(uc.getResponseCode());
    System.out.println(uc.getResponseMessage());
    catch(Exception io)
    io.printStackTrace();
    System.out.println("error message........" io.getMessage());
    In web.xml I have d

  • MVC: Tell a controller class which controller called it

    I have to controller pages (page1.do and page2.do) that both shall use the same controller class (CL_CTR).
    Can I tell in DO_REQUEST of the controller class whether page1.do or page2.do called the controller class?

    Hi Daniel,
    To call page1(2).do's from do_request you first put the following in DO_INIT.
    data:  page1details type ref to cl_bsp_controller2.
    page1details ?= create_controller( controller_name = 'page1details.do'
                                        controller_id = 'subcntlr1_id' ).
    similarly you should do the same for page2.
    Then in DO_REQUEST.
    data: subcontroller1 type ref to cl_bsp_controller2.
    subcontroller1 ?= get_controller( controller_id = 'subcntlr1_id' ).
      call_controller( subcontroller1 ).
    I hope this helps.
    If it doesn't work let me know.
    Regards
    Amit
    Message was edited by: amit kumar

  • Running a Java class which depends on a Jar

    Hi,
    I try to run a class using the command java packagename.classname.
    This class depends on a jar for functioning.
    So, when I run this class, exception related to the absence of this Jar is shown.
    How can I overcome this? Where should I place this jar or running any other commands for loading this jar will do?
    Please help.
    Any help in this regard will be well appreciated with dukes.
    Regards,
    Rony

    Hi Rony,
    Place the that jar file in your class path.
    or
    Place that "jar file path" in Enivronment Variables of your computer under "Class path" variable
    or
    set the class path using command prompt.
    Thanks,
    Sekhar

  • Can A Java class make a call to a control ?

    We are using Workshop 8.1 - is this doable without using a web service and calling
    proxies ?
    Thanks

    No... It would be very nice feature.
    "ghulam" <[email protected]> wrote in message
    news:3fe9bcf2$[email protected]..
    >
    We are using Workshop 8.1 - is this doable without using a web service andcalling
    proxies ?
    Thanks

  • Sample java program which will call SAP bapi function to get PO details from SAP

    Hi all,
    I am new to bapi with sap, Any one guide me to interface with sap in java to get details from PO order,From Java end if i put particular PO number it will get details about PO from SAP...Any one guide me r send sample code..
    Thanks in Advance.
    Thanks
    Baskar.

    hi guru,
    Can you please send me the same to my e mail as well...
    my email address is [email protected] ..Thank you
    Regards,
    Baskar.

  • Issue with Java Class based DataControls.

    Hi,
    I'm actually working with JDev 11.1.1.3.0.
    And we got a requirement to build a search page which should create a dynamic query. And we are not using ADF BC in this project.
    Instead, writing some ServiceDelegates(Java Classes) which internally calls EJB services to do CRUD operations.
    Finally, created DataControls using these Service Delegates to design UI.
    Now one thing is clear that .... we are using java class based service delegates.
    *Issues
    =======
    1. I have a table with 4 columns, in which 2 columns are of type selectOneChoice.
    2. Now, based on first selectOneChoice selection ... second selectOneChoice should display corresponding values. It is something like this. First select one choice contains all KEYS. Based on the KEY selection second select OneChoice should display VALUES corresponding to the KEY.
    3. I have around 20 KEYS in the first selectOneChoice.
    4. User can add rows to the table as many as they want.
    5. For each row, the first selectOneChoice is same(contains same keys).
    The issue is, For the first time(when user logs into the screen ....) the table will be displayed with one row which contains 2 selectOnechoices and 2 inputText boxes and a ADD button at the end of each row.
    1. User selected a KEY from first selectOneChoice. Hence, second selectOneChoice populates values corressponding to KEY. And user clicked on ADD button.
    2. Now the first row was like that only. And a new Row got added to the table.
    3. In the second row ... Now user selected a different KEY in first selectOneChoice. And the second selctOneChoice displayed values corresponding to KEY selected.
    4. This is also fine. But now, when user tried to click on ADD button to add THIRD ROW ... the table got added with a new row.
    5. Here is the problem.... From here onwards, whenever any new row get added to the table ... the first row's second selectOneChoice values are setting with values of second row's secondSelectOneChoice.
    6. Finally ... what i'm trying to do is, the second selectOneChoice should not get affected/refreshed because of adding a new row.
    If it is not clear ... please share your email address. I can share the sample code with you.
    This is an high priority task given to me.
    Please let me know your comments ASAP.
    Thanks & Regards,
    Kiran Konjeti

    You could try the following to see where the class was loaded from.
    System.out.println(ResourcesAndRatesForm.class.getProtectionDomain().getCodeSource());

  • JCX access from java class

    Is it possible to access jcx from java class ?
    from jpf i am calling java class which inturn calls jcx and
    i am getting nullpointer exception at jcx call in java class
    waiting for solution...
    thanks,
    sridhar

    Shrishar,
    Unfortunately in the current release controls cannot be accessed from stand
    alone java classes. You can create a custom control which can invoke the jcx
    and be invoked from within the jpf.
    Regards,
    Raj Alagumalai
    Backline Workshop Support
    "sridhar" <[email protected]> wrote in message
    news:4083d449$[email protected]..
    >
    Is it possible to access jcx from java class ?
    from jpf i am calling java class which inturn calls jcx and
    i am getting nullpointer exception at jcx call in java class
    waiting for solution...
    thanks,
    sridhar

  • Custom Java class called from RTF template generates error

    We are running a report in BI Publisher and the report calls a custom developed Java class that is used to bind PDFs together and sent the result to another application.
    On the RTF template we have some XSLT that reads the input XML and sets a variable which is then passed to the Java class. We are however getting the following error when the report is called simultaneously 2 or more times:
    XML-22044: (Error) Extension function error: Error invoking 'JavaClassName': 'java.lang.Error: Cannot interweave overlay template with pdf input, combined number of pages is odd!
    I read this as the real cause of the error is the Java code but I'm not 100% sure. Also I don't understand what the error message means.
    Could someone help out please?
    Many thanks

    Since our this requirement is in Quotes module, its not using OAF. It is using plain JSPs and java classes.
    What i was thinking is, create the Option values as flex fields, and write a custom java class to fetch these data from the flex tables and use it in the JSP.
    The main problem we are facing now is,
    "...we wrote a simple java class, which establishes database connection, executes a simple insert & select query to our custom table. compiled & placed the class file under our new pkg structure under $JAVA_TOP eg. oracle.apps.xxx.quot.tmpl , bounced the apache."
    But when we tried to import this class in the jsp (which is being customized), the app just throwed Internal Server Error and we couldnt find any info in the Log file.
    Couldnt guess, why is this simple thing failing. Any idea ?

  • How to call java class file from jsp

    hi
    we need to call java classes (which are written separately in .java file )from jsp file. we need it for our project if anyone knows about please reply us.
    bye
    siva sankari

    you can call the methods in a lot of ways. you could use scriptlets with the
    <%@ page import="package.class"%> and then inside instantiate an object
    <%
         MyClass mc = new MyClass(parameters if any);
         mc.theMethodYouWantToCall();
    %>or as Madathil has stated,
    or use the JSP tags
    <jsp:useBean id="anyname" class="classname"/>and then use the getProperty tag
    or even Custom Tags

  • How to set the classpath and path from the jsp to call  java class function

    Hi Exprets,
    I have a requirement to call a java class function which returns a hashmap object from the jsp. The java class in present in one jar file and that jar file is location somewhere in unix path. So the requirement is to set the classpath for that jar file and then create the object of the java class and then call the function.
    If any one know how to achieve it, please reply as soon as possible.
    thanks in advance,
    swapna soni.

    It is never advisable to store large data sets in the session. But it will depend on a lot of factors:
    1. How costly is the query retrieving the data from the database?
    If it's a complex query with lots of joins and stuff, then it will be better to store it in the session as processing the query each time will take a lot of time and will decrease performance. On the other hand if the query is simple then it's advisable not to store it in the session, and fetch it each time.
    2. Are there chances for the data to become stale within a session?
    In this case storing the data is session will mean holding the stale data till the user session lasts which is not right.
    3. How many data sets does the session already holds?
    If there are large no. of data sets already present in the session, then it's strictly not advisable to store the data in the session.
    4. Does the server employ some kind of caching mechanism?
    Using session cache can definitely improve performance.
    You will have to figure out, what is the best way analyzing all the factors and which would be best in the situation. As per my knowledge, session is the only place where session specific data can be stored.
    Also, another thing, if the data set retrieved is some kind of data to be displayed in reports, then it would be better to use a pagination query, which will retrieve only the specific no. of rows at a time. A navigation provided in the UI will retrieve the next/previous data set to display.
    Thanks,
    Shakti

  • Read item from Java class and call to stored function/procedure of database

    Hi,
    I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
    I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
    question1: How can I read jsp pages items value to java class ?
    question2: How can I call to database stored function/procedure with that parameter?
    question3: How can I use return value of that stored function/procedure ?
    Please reply me .
    Thanks,
    zakir
    ===
    Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM

    ---

Maybe you are looking for

  • HT201210 my iphone 3gs is showing errors wen i turn on debug and some apps will open and then close.

    my iphone 3gs is showing errore wen i turn on debug and some apps will open and then close

  • Why won't my Macbook Pro Retina not hook up to Air Play Via Apple TV

    So I want to hook up my laptop to the TV. Now Everything is up to date and my model is 2013 computer and the latest addition of the Apple TV Product. I have the top icon on my screen and click on my name, enter my password, but then it says it cannot

  • Using Spaces (in the System Preferences)

    I have enabled the Spaces from the System Preferences to keep my programs more organized. I am a graphic designer and I use almost every program of the Adobe Suite on a regular basis. I had put the different programs in four different spaces because

  • RH 6 - publish fail

    One of our authors is having issues publishing a project that they have published before with no problems.  Here is the error message they received: Publishing has been cancelled. Connection failed.  Please check the connection and post again. Native

  • XI Components Missing

    Hi all,        When i created the business system with role as integration server, i got an error message that " technical system already has an integration  server, So it has to be declared as Application system". So i deleted the technical system a