Using get method on hashtable
I have built two hashtables and populated them with my data, but now I need to get the key from one table and see if it exists in the other, I've seen the get method in the api but I can't understand how to use it? Could someone show me a simple example of how to use the get method?
kajbj wrote:
Do you have Hashtable or HashMap or a datastructure of your own? They're both Hashtables:
Hashtable<String, String> activeData;
Hashtable<String, String> passiveData;I've written this piece of code, not tested it yet though:
public void doComparison(Hashtable<String, String> activeData, Hashtable<String, String> passiveData)
Enumeration<String> e = activeData.keys();
Enumeration<String> f = activeData.elements();
while (!activeData.isEmpty())
activeData.get(e);
if (passiveData.containsKey(e))
//Keys match, now check data
activeData.get(f);
if (passiveData.containsValue(f))
//Both key and value matched
passiveData.remove(e);
passiveData.remove(f);
activeData.remove(e);
activeData.remove(f);
else
//The keys matched, but the data linked to them did not
//Call the output class here
passiveData.remove(e);
passiveData.remove(f);
activeData.remove(e);
activeData.remove(f);
else
//Keys did not match, output the differences
//Call the output class here
passiveData.remove(e);
passiveData.remove(f);
activeData.remove(e);
activeData.remove(f);
}Edited by: jnaish on Aug 15, 2008 1:53 AM
Similar Messages
-
Problems using GET method in JSP
Hi,
I had some problems using GET method in JSP.
I'm using Apache web server 1.3 and Tomcat 3.3.1 in windows 2000.
And I'm using language English and Korean.
When I send messages using POST method, all is good
But when I send message using GET method, English is good, but Korean is not good.
I tried to encode using
URLEncode.encode(str, "UTF-8")
and decoding it using
URLDecode.decode(request.getParameter(tag), "UTF-8")
but it didn't work.
How can I receive request including Korean using GET method in JSP?
If anyone have solutions, please let me know.
thanks.Hi,
I had some problems using GET method in JSP.
I'm using Apache web server 1.3 and Tomcat 3.3.1 in
windows 2000.
And I'm using language English and Korean.
When I send messages using POST method, all is good
But when I send message using GET method, English is
good, but Korean is not good.
I tried to encode using
URLEncode.encode(str, "UTF-8")
and decoding it using
URLDecode.decode(request.getParameter(tag), "UTF-8")
but it didn't work.
How can I receive request including Korean using GET
method in JSP?
If anyone have solutions, please let me know.
thanks.This problem appears, when one use UTF-16 encoding in JSP - am I right?
If so there are two solutions:
1) Temporary: Use "UTF-8" - or any other 8 bit encoding scheme and
encode Korean symbols with "&1234;" kind of escapes - though it
may not work
2) Absolute: get my piece of code, which I have managed to write
just a month ago resolving absolutely similar problem with UTF-16
in code using Chinese/Russian/English encodings
But I wouldn't say that it's costs 10 DDs :) - it's much more
expensive... So try 1st variant if it wouldn't help - let me know.
I'll figure :)
Paul -
Revision: 10891
Author: [email protected]
Date: 2009-10-06 09:46:47 -0700 (Tue, 06 Oct 2009)
Log Message:
Fix for ASDoc throws error when using getter methods for pseudo-inheritance of static constants
QE notes: None.
Doc notes: None
Bugs: SDK-22676
Tests run: checkintests
Is noteworthy for integration: No
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-22676
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.javaHave you tried using com.adobe.air.crypto.EncryptionKeyGenerator instead?
-
Validations when we use GET method
Hi Team,
I am using GET method with the following URL(example)
http://IP:8080/ords/schema_name/office/users/{user_id}
URI template : office/users/{user_id}
method:get
source type : Feed
Source : select * from emp where empno = :user_id;
Using the above URL I am able to get all the specified user details in the browser.
I want to add the validations to the service now, and response should be user defined.
Ex : when user not in the database
then respond with the error code and error name in JSON format ex:
items:
error code : 404
message: "somthing wrong"
I am not sure how we can achieve this functionality when we use SQL query.
Please suggest any possible solutions for this.
thanks
Chandrangrant dba_users view to apex and change the sql like this:
select * from emp where empno = :user_id and exists (select 1 from dba_users where username=:user_id); -
NullPointerException thrown when using get method in CMR relationship outsi
We are using weblogic 9.1 CMP entity beans with BEA's XA oracle driver. We have a bean called User that has a many address beans. When calling the getAddresses method on a UserLocal a NullPointerException gets thrown if the stateless session bean method that is marked as @LocalMethod(transactionAttribute=Constants.TransactionAttribute.SUPPORTS). If we change it to REQUIRED the method returns addresses successfully. Does anyone have any ideas as to what could be causing this? Below is the stack trace.
My best guess is that an exception is occurring and when weblogic tries to handle the exception EJBRuntimeUtils.throwEJBException encounters the NullPointerException.
javax.ejb.EJBException: EJB Exception: : java.lang.NullPointerException
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68__WebLogic_CMP_RDBMS_addresses_Set.<init>(echo_user_User_l47u68__WebLogic_CMP_RDBMS_addresses_Set.java
:93)
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68__WebLogic_CMP_RDBMS.getAddresses(echo_user_User_l47u68__WebLogic_CMP_RDBMS.java:1161)
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68_ELOImpl.getAddresses(echo_user_User_l47u68_ELOImpl.java:770)
at gov.nasa.echo.subsystems.user.UserTypeMap.convertUser(UserTypeMap.java:66)
at gov.nasa.echo.subsystems.user.UserSubsystem.getUserByUserId(UserSubsystem.java:321)
at gov.nasa.echo.subsystems.user.UserSubsystem.getUsersByUserId(UserSubsystem.java:302)
at gov.nasa.echo.services.authentication.AuthenticationServiceBean.login(AuthenticationServiceBean.java:442)
at gov.nasa.echo.services.authentication.AuthenticationServiceBean_plcr77_ELOImpl.login(AuthenticationServiceBean_plcr77_ELOImpl.java:1001)
at gov.nasa.echo.v8.AuthenticationServicePortImpl.login(AuthenticationServicePortImpl.java:105)
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:585)
at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassComponent.java:91)
at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(ComponentHandler.java:68)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:84)
at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:60)
at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:124)
at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
; nested exception is: java.lang.NullPointerException
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:141)
at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:643)
at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:604)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:347)
at weblogic.ejb.container.internal.BaseLocalObject.postInvokeTxRetry(BaseLocalObject.java:286)
Truncated. see log file for complete stacktraceJason Gilman wrote:
We are using weblogic 9.1 CMP entity beans with BEA's XA oracle driver. We have a bean called User that has a many address beans. When calling the getAddresses method on a UserLocal a NullPointerException gets thrown if the stateless session bean method that is marked as @LocalMethod(transactionAttribute=Constants.TransactionAttribute.SUPPORTS). If we change it to REQUIRED the method returns addresses successfully. Does anyone have any ideas as to what could be causing this? Below is the stack trace
My best guess is that an exception is occurring and when weblogic tries to handle the exception EJBRuntimeUtils.throwEJBException encounters the NullPointerException.
Open an official support case. This has nothing to do with jdbc.
Joe
>
>
javax.ejb.EJBException: EJB Exception: : java.lang.NullPointerException
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68__WebLogic_CMP_RDBMS_addresses_Set.<init>(echo_user_User_l47u68__WebLogic_CMP_RDBMS_addresses_Set.java
:93)
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68__WebLogic_CMP_RDBMS.getAddresses(echo_user_User_l47u68__WebLogic_CMP_RDBMS.java:1161)
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68_ELOImpl.getAddresses(echo_user_User_l47u68_ELOImpl.java:770)
at gov.nasa.echo.subsystems.user.UserTypeMap.convertUser(UserTypeMap.java:66)
at gov.nasa.echo.subsystems.user.UserSubsystem.getUserByUserId(UserSubsystem.java:321)
at gov.nasa.echo.subsystems.user.UserSubsystem.getUsersByUserId(UserSubsystem.java:302)
at gov.nasa.echo.services.authentication.AuthenticationServiceBean.login(AuthenticationServiceBean.java:442)
at gov.nasa.echo.services.authentication.AuthenticationServiceBean_plcr77_ELOImpl.login(AuthenticationServiceBean_plcr77_ELOImpl.java:1001)
at gov.nasa.echo.v8.AuthenticationServicePortImpl.login(AuthenticationServicePortImpl.java:105)
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:585)
at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassComponent.java:91)
at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(ComponentHandler.java:68)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:84)
at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:60)
at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:124)
at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
; nested exception is: java.lang.NullPointerException
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:141)
at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:643)
at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:604)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:347)
at weblogic.ejb.container.internal.BaseLocalObject.postInvokeTxRetry(BaseLocalObject.java:286)
Truncated. see log file for complete stacktrace -
How to use get() method of hashmap in jsp
Hi,
Iam using hashMap in action form from which I want to retrieve the value by giving the key in jsp page.
ex: HashMap m = new HashMap();
m.add("key", "value");
String v = m.get("key");
I want to know how implement m.get("key") in jsp without doing iteration.
Thanks & Regards,
Nasrin.NHi
First of all I would say that there is no "add" method for Hashmap, its put
secondly try this
<bean:write property="map_key" name="mapSetterGetter" /> -
Passing values from applet using POST method to PHP page
Hello there ;)
I realy need a help here.. I`ve been working all day on sending mail from applet. I didn`t succeed bcs of the security restrictions.
So I decided just to pass arguments into PHP page, which process them and send e-mail to me.
So here is the problem.. I need to send String variables througth POST into my php page. Now I`m using GET method, but I need more than 4000 characters.
My actual solution is:
URL url = new URL("http://127.0.0.1/index.php?name=" + name + "&message=" + message);
this.getAppletContext().showDocument(url,"_self");I really need to rewrite it into POST. Would you be so kind and write few lines example [applet + php code]? I`ve already searched, googled, etc.. Pls don`t copy links to other forums here, probably I`ve read it.
Thanx in advance to all :)hi!
i`ve got some news about my applet.. so take this applet code:
public class Apletik extends JApplet {
public void init() { }
public void start()
try
String aLine; // only if reading response
String parametersAsString = "msg=ahoj&to=world";
byte[] parameterAsBytes = parametersAsString.getBytes();
// send parameters to server
URL url = this.getCodeBase();
url = new URL(url + "spracuj.php");
URLConnection con = url.openConnection();
con.setDoOutput(true);
con.setDoInput(true); // only if reading response
con.setUseCaches(false);
con.setRequestProperty("Content=length", String.valueOf(parameterAsBytes.length));
OutputStream oStream = con.getOutputStream();
oStream.write(parameterAsBytes);
oStream.flush();
String line="";
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
while ((aLine = in.readLine()) != null)
JOptionPane.showMessageDialog(null, aLine);
if(aLine.equals("")) break;
in.close();
oStream.close();
catch (Exception ex)
JOptionPane.showMessageDialog(null, ex.toString());
}here is code of spracuj.php which is on server:
<?php
if(isset($_POST['msg']))
echo('hurray!');
?>it has only 1 problem.. when i test it on my localhost, everything seems to be all right. but when i post it to my server, i got IOException HTTP 400 error code :( where is the problem? please help me, i`m so close :D thanx -
[REPOST]How to force ADF Dialog / POPUP to use POST method ?
Hi all,
Is there any way to make ADF Dialog / POPUP to use POST method ?
I need that approach to implement this post : [SOLVED] Faces - Preventing user from entering URL manually
But it breaks in my application because ADF Dialog / POPUP is using GET method.
Thank you very much,
xtantorepost.
Thank you -
Login to a website using httpURLConnection and GET methods
Hello,
I would like to write a java program that connects to a website, logs in by sending relevant data to the javascript I copy-pasted below and then retrieves the information of the webpage reached after successful login.
<FORM method="post" name="loginForm" action="/cvg/dispatch/login/submit">
<TABLE>
<TR>
<TD>
<TABLE BGCOLOR=#D0E2FF WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0">
<TR><TD COLSPAN=2>�</TD></TR>
<TR>
<TD ALIGN="RIGHT"><FONT SIZE=3>login</FONT></TD>
<TD><input type="text" name="loginValues.userName" value="" size="15" maxlength="30" ><input type="hidden" name="priority-normal" value="loginValues.userName"></TD>
</TR>
<TR>
<TD ALIGN="RIGHT"><FONT SIZE=3>password</FONT></TD>
<TD><input type="password" name="loginValues.password" value="" size="15" maxlength="30" ><input type="hidden" name="priority-normal" value="loginValues.password">
</TD>
</TR>
<TR>
<TD ALIGN="CENTER" COLSPAN=2>
<input type="image" name="Login" value="Login" src="/cvg/images/login-button.gif" alt="Login" border="0" width="67" height="33" ><input type="hidden" name="submitButton" value="Login"><input type="hidden" name="Login-action" value="Login">
</TD>
</TR>
</TABLE>
Thanks for your helpUsing POST
http://forum.java.sun.com/thread.jspa?threadID=645830
second POST
Using GET
URL u = new URL("http://server/cvg/dispatch/login/submit?loginValues.userName=user&priority-normal=loginValues.userName&loginValues.passwor=password&priority...")
By the way the html you provided does not use GET at all, it uses POST
<FORM method="post" ring any bell?
As for javascript, I don't see any script on the html page you provide, nor
do I see any onsubmit or onclick action. -
In SharePoint 2010, I am trying to copy pdf file programmatically from a non-RMS protected document library into RMS protected library using copyTo() method.
But I am getting an error while doing so. it gives error as mentioned below -
This library does not accept files of the given type. You must either upload a
new, unprotected file that supports rights management or re-upload a document
that was previously downloaded from this library.
Please suggest some solution.
Thanks,Are You sure that you have give 'PDF' in caps in your program? and check whether you are getting all the datas before calling the method.
in my program, i have used like this and it is working fine for me,
I am getting PDF content from the form...
DATA ls_formoutput TYPE fpformoutput.
DATA pdf_content TYPE solix_tab.
DATA lp_pdf_size TYPE so_obj_len.
DATA lv_mail_title TYPE so_obj_des.
*Attach the PDF .
lp_pdf_size = XSTRLEN( ls_formoutput-pdf ).
pdf_content = cl_document_bcs=>xstring_to_solix(
ip_xstring = ls_formoutput-pdf ).
document->add_attachment(
i_attachment_type = 'PDF'
i_att_content_hex = pdf_content
i_attachment_size = lp_pdf_size
i_attachment_subject = lv_mail_title ) . -
Hi Experts,
How can i get a file header using this method cl_gui_frontend_services=>gui_download
Thanks
BasuHi,
You can use the FM - GUI_DOWNLOAD to specify the headers. It can be done in the following manner -
TYPES: BEGIN OF ty_head, "Structure for header
h(10) TYPE c,
END OF ty_head.
DATA: it_head TYPE TABLE OF ty_head WITH HEADER LINE.
"Adding header details
it_head-h = 'Field1'.
APPEND it_head.
it_head-h = 'Field2'.
APPEND it_head.
it_head-h = 'Field3'.
APPEND it_head.
it_head-h = 'Field4'.
APPEND it_head.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'ASC'
write_field_separator = 'X'
header = '00' "<= note this
TABLES
data_tab = it_tab
fieldnames = it_head[] "<= Pass your header table here
EXCEPTIONS
OTHERS = 1.
Hope this helps.
Regards,
Himanshu -
Getting error while using TRIM method in collections
Hi Experts,
While using TRIM method I am getting below error. Am I doing any mistake here ?
DB : Oracle 11g
SQL> declare
2
3 type emp_tab is table of employees%rowtype index by binary_integer;
4 l_emp_tab emp_tab;
5
6 begin
7
8 select * bulk collect into l_emp_tab from employees;
9 l_emp_tab.trim(5);
10 dbms_output.put_line(l_emp_tab.count);
11
12 end;
13 /
l_emp_tab.trim(5);
ERROR at line 9:
ORA-06550: line 9, column 2:
PLS-00306: wrong number or types of arguments in call to 'TRIM'
ORA-06550: line 9, column 2:
PL/SQL: Statement ignored
Thanks in advance for all your help.
Cheers,
SuriGerard, and to Unkonwn epxpert ;-)
Thanks for the reply. I am aware about extend method. But not sure about TRIM. Once again thanks for your help.
Cheers,
Suri -
Authentication syntax for HTTP GET method using TCP functions in Labview on linux
Hi,
Currently, I am trying to communicate to web server. I have Labview installed on a Linux machine. The HTTP function blocks and other labview functions do not work. Hence, I am building a HTTP code string using TCP functions (port 80) to talk to the web server. I am successfully able to fetch a response from web sites (example www.ni.com) from my vi. However, when I try to communicate to my web server, it does not work. It requires an authentication. I am able to open http://ipaddress in my browser from my machine using username and password. Can someone help with Authentication string requirement for GET method?
so far the string is:
GET /index/ HTTP/1.1
Host: http://xx.xx.xx.xxAn easy option would be to try http://userassword@server syntax for the URL.
Else I posted a Twitter fetcher once (won't work anymore since Twitter moved to Oauth authentication) at LAVA. Based on code from @cloew.
The code is part of this LLB.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
Retrieving image using HTTP GET method?
I want to send a image to a client browser. My servlet's HTML response to the client browser contains the <img src="..."> tag. The client browser uses the HTTP GET method to call my servlet's DoGet method, and I must transfer the desired image to the client browser in this DoGet method at servlet. Now, the problem is that, what should be the source URL in the image(img) tag that is present in my servlet response to client?
For eg: the img tag should be like this
<img src="http://<hostname>:<portname>/<servletname>/...?[var1=value1]">
Now at the ellipsis that you see in the above source URI, I want to write the type of image file (something.jpg) ,so the browser knows what kind of image file it is.
To sum it up...how to get the image using DoGet method and <img src="...">
Regards,
AmitTo give you a better idea on what's happening, read the RFC:
(HTTP/1.0) http://ftp.ics.uci.edu/pub/ietf/http/rfc1945.html
(HTTP/1.1 - compressed data)
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
If you for example execute the command by telnetting to port 80 on a server:
GET http://somewhere.com/some.jpg HTTP/1.0<cr>
<cr>You will get this header:
Trying 217.22.64.73...
Connected to xxx.xxx.xxx
Escape character is '^]'.
HTTP/1.1 200 OK
Date: Fri, 01 Aug 2003 12:36:30 GMT
Server: Apache/1.3.27 (Unix) FrontPage/5.0.2.2510
Last-Modified: Tue, 15 Jul 2003 03:11:52 GMT
ETag: "268de8-2fc4-3f1370f8"
Accept-Ranges: bytes
Content-Length: 12228
Connection: close
Content-Type: image/jpegWatch the last part, that's what the setContentType does, normally the content-type defaults to text/html in a webserver.
A webserver usually maintains a list of file extensions by which it will determine the correct MIME type to emit, when a resource is retrieved.
The browser reads the header, and decides what to do with it, in combination with (X)HTML markup.
Greets. -
No getter method when used html:text
hi frnds,
this is the way i ve written-->
<html:text name="bdgtmastForm" property="publicity_code" size="5" maxlength="5">
but its giving me an error which seems irrelevent..
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /pages/admin/addbdgt.jsp:61
58: <tr>
59: <td width="50%" height="25"><strong><small><font face="Verdana">Publicity Code </font></small></strong></td>
60: <td width="50%" height="25">
61: <html:text name="bdgtmastForm" property="publicity_code" size="5" maxlength="5"></html:text>
62: <!-- <input type="text" size="5" maxlength="5" name="publicity_code"></td> -->
63:
64: </tr>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:467)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:371)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
root cause
javax.servlet.ServletException: No getter method for property publicity_code of bean bdgtmastForm
org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:779)
org.apache.jsp.pages.admin.addbdgt_jsp._jspService (addbdgt_jsp.java:89)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
root cause
javax.servlet.jsp.JspException: No getter method for property publicity_code of bean bdgtmastForm
org.apache.struts.util.RequestUtils.lookup(Request Utils.java:968)
org.apache.struts.taglib.html.BaseFieldTag.doStart Tag(BaseFieldTag.java:176)
org.apache.jsp.pages.admin.addbdgt_jsp._jspx_meth_ html_005ftext_005f0(addbdgt_jsp.java:577)
org.apache.jsp.pages.admin.addbdgt_jsp._jspx_meth_ html_005fform_005f0(addbdgt_jsp.java:184)
org.apache.jsp.pages.admin.addbdgt_jsp._jspx_meth_ html_005fhtml_005f0(addbdgt_jsp.java:116)
org.apache.jsp.pages.admin.addbdgt_jsp._jspService (addbdgt_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
Apache Tomcat/5.5.23
my bean class is--->
public String getPublicity_Code()
return(this.publicity_code);
why am i getting this error when i ve already declared publicity_code in the bean class????
regards,
a_josephhi guyz,
herz my jsp page for submiting the values,
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html>
<head>
<title>Budget Master Administration</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<SCRIPT LANGUAGE="JavaScript" SRC="bscript.js"></SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body topmargin="0" leftmargin="0" bgproperties="fixed">
<div align="left">
<html:form action="/BdgtMastAction" name="bdgtmastForm" type="publicity.BdgtMastForm" method="get">
<table border="0" width="100%">
<tr>
<td width="100%" bgcolor="#DFDFFF" background="images/niceblue.gif"><font face="Tahoma"
color="#000000"><strong>B u d g e t M a s t e r</strong></font></td>
</tr>
</table>
<div align="left">
<table width="60%" height="127">
<tr>
<td valign="top" width="50%" height="34"><strong><small><font face="Verdana"></font></small></strong></td>
<td width="50%" height="34"></td>
</tr>
<tr>
<td valign="top" width="50%" height="27"><strong><small><font face="Verdana">Branch</font></small></strong></td>
<td width="50%" height="27">
<!-- <input type=hidden name="option" value="new"> -->
<html:hidden name="bdgtmastForm" property="option" value="new"/>
<p>
<html:select property="branch" size="1">
<html:option value="Bombay"></html:option>
<html:option value="Ahmedabad"></html:option>
<html:option value="Madras"></html:option>
<html:option value="Bangalore"></html:option>
<html:option value="Calcutta"></html:option>
<html:option value="Hyderabad"></html:option>
<html:option value="Pune"></html:option>
<html:option value="Lucknow"></html:option>
<html:option value="Jaipur"></html:option>
<html:option value="Patna"></html:option>
<html:option value="Cochin"></html:option>
<html:option value="Chandigarh"></html:option>
<html:option value="Bhopal"></html:option>
</html:select>
</p>
</td>
</tr>
<tr>
<td width="50%" height="25"><strong><small><font face="Verdana">Publicity Code </font></small></strong></td>
<td width="50%" height="25">
<html:text name="bdgtmastForm" property="publicity_Code" size="5" maxlength="5"></html:text>
<!-- <input type="text" size="5" maxlength="5" name="publicity_code"></td> -->
</tr>
<tr>
<td width="50%" height="25"><strong><small><font face="Verdana">Annual Budget Alloted (<em>Rs</em>)</font></small></strong></td>
<td width="50%" height="25">
<!-- <input type="text" size="10" maxlength="10" name="budget"> -->
<html:text property="budget" name="bdgtmastForm" size="10" maxlength="10" ></html:text>
</td>
</tr>
</table>
</div>
<p align="left">
<html:submit value="Submit" property="thesubmit" onclick="everything(form)"> </html:submit>
</p>
<hr>
<strong><small><font color="#0080C0">
<p align="center">�</font><font color="#0080C0" face="Verdana">Response - Corporate
1998-1999</font></small></strong>
</html:form>
</div>
</body>
</html:html>
and the exceptions that im getting when clicked on submit
when i click on submit normally the javascript validation shud check for improper values,instead its getting submitted,and the below exceptions r the result..
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Column 'Publicity_Code' cannot be null
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'Publicity_Code' cannot be null
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1585)
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1500)
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1485)
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
publicity.BdgtMastAction.execute(BdgtMastAction.java:57)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
Apache Tomcat/5.5.23
Maybe you are looking for
-
Applet very slow and shows no activity, but its running
I have a new applet for the users, but I am reluctant to implement until I get some others opinions. It is very slow (30 - 40 seconds) Before it outputs a screen with about 20 lines, it reads 90 different html files. It looks at the forth rec of each
-
I have my company directory in my contacts on my iphone. There are several people with the same name. Too many to change. When I try to use email & select the contact there is no way to know if i selected the correct person. Is there a way to see mor
-
If I want to make a collage in which images appear within a very large number, how can I do it? The project is to present a hockey player (a child) with an 8x10 image on which is their player number containing images of the kid in hockey gear. I have
-
Where do you find a step by step tutorial explaining the cloud ?
New to the Apple family and I am looking for a step by step turtorial for setting up the I phone to the I pad via the I cloud ?
-
Need help with the query to write Cipher?
Hi, I was assigned a task to write a query to encrypt and decrypt some Cipher. I have figured out to write the procedure to encrypt and decrypt ceasar cipher. I would really appericate if you guys could help me out with this. .Caesar Cipher 2.Monoa