Using jsp to read a input from a radio button
i am trying read a input from a radio button ,normly if the name of radio button is "priority" and if u referrence it as request.getParameter("priority") it shld work right but mine does not.
<% rs = stmt.executeQuery("select PRIORITYNAME,PRIORITYDESC from TBL_PRIORITY ");
<td>Priority</td>
<% while(rs.next())
%>
<input name="priority" type="radio"><% out.println(rs.getString(1)); %><% out.println(rs.getString(2)); %><br>
<%
%>
is it bcs i am using a loop !! bcs am populating the radio fields from a database
i am trying read a input from a radio button ,normly
if the name of radio button is "priority" and if u
referrence it as request.getParameter("priority") it
shld work right but mine does not.
A couple of things not necessarily addressing your problem, but still..
Avoid too much Java code in the JSP. Use existing tags or write new custom tags to do the task.
Avoid database access form the JSP itself, if possible.
<% rs = stmt.executeQuery("select
PRIORITYNAME,PRIORITYDESC from TBL_PRIORITY ");
<td>Priority</td>
<% while(rs.next())
%>
<input name="priority" type="radio"><%
out.println(rs.getString(1)); %><%
out.println(rs.getString(2)); %><br>
<%
%>
I'm not quite sure what are you trying to do with the above. You want the labels of the radio buttons to be obtained from the database as well as their values, is it?
Does PRIORITYNAME correspond to the value of the radio button and PRIORITYDESC correspond to the label of the radio button?
If that's the case, I think you need to do it as follows:
Radio button is declared as follows in HTML
<input name="priority" type="radio" value="<%rs.getString(1)"%>><%rs.getString(2)%></input>
is it bcs i am using a loop !! bcs am populating the
radio fields from a databaseNo
Similar Messages
-
I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication.
I use LabVIEW to read the data from serial communication then, i open the example (.vi) from Serial Communication - Advanced Serial Write and Read from LabVIEW Example. BUT it have some error message that : Error - 1073807202 occured at property node in visa configure serial port (instr).vi -> advance serial write and read .vi
this error code is undefined. no one has provide a description for this code, or you might have wired a number that is not an error code to the error code input.
I don't know why? please help me. thank you.When I copy that code into "Explain Error" I get: "VISA: (Hex 0xBFFF009E) A code library required by VISA could not be located or loaded."
You may have a bad install of VISA or the wrong version of VISA loaded. Try re-installing VISA. You can get the latest version from the NI support site: http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C0E91?opendocument&node=1....
Also ensure that you are not pointing the example towards a serial port that does not exist.
Please let us know what you find and what gets this working for you.
Rob -
Reading user input from a form within a workflow and perform actions in workflow based on the input
Sharepoint 2013
Need to get input from a user based on some condition within a workflow and based on the input received continue with the workflow. It can be a form with a text box and button to which i can redirect and when user enters a value and clicks on the button
,I should come back to the workflow and perform other processing. I should also be able to manually start this workflow from VS.
Tried different approaches like initiation forms ,user input action of SP2010 etc all of these approaches either add some tasks to task list or force me to click on the workflow link to get input from a user.
Any suggestions on this?Hello
Thanks for the code, but I don't need an array of beans. By the way this code make a bean and an arraylist everytime it's called?
I was looking for something like this:
<form action="myjsp.jsp" method="post">
...so after submitting the result will go to the myjsp.jsp file and in the myjsp.jsp file
<jsp:useBean id="value" class"myBean">
<jsp:setpropertiy name"value" ....>so everytime I click the add button the values will go the mysjp.jsp file and that will set them in the javabean file. this method uses two files but I was looking for doing this in the same jsp file and not sending it to another file.
chers
Ehsan -
Is LabView able to read digital inputs from maxon motors controller, EPOS2?
Hello,
I would like to ask that if LabView is able to read any digital inputs directly from a maxon motor controller, EPOS2. As i have tried making a new VI from the maxon example VI, but the difference is that i've added a input control. But the program doesn't seems to work.
That's why i would like to ask if LabView can read a direct digital input from the maxon motor controller.
Thank You & Regards,
ParkyPak
Attachments:
sensor.vi 34 KBHello Parky,
I understand now. I check on the motion controller and it is connected through USB to your computer. In term of controlling the motion controller, you are using some LabVIEW library from maxon. The photosensor is connected to the motion controller may be as a switch or as a limit switch.
In order to read the value of the Digital input port, you may need to take a look of the libraries to check on what function call and the supported command to check the digital input port. If this is not successful, then question or referring to examples from Maxon motors would be the best.
I hope that this helps.
James
- Meadow -
LabVIEW 7.0 - 2011, Vision, RT, FPGA
TestStand 3.0 - 4.5 -
Gents,
I'm a XML & JSP newbie and try to do the following: I have a xml file which can be opened with a browser so that I can see data (let's say my cd collection). Further I have a xls file which makes the display a little nicer, with colors and so. Now, I want to have a jsp page read this xml file and I'm not very succesfull, while I spent hours and hours on Google, but nothing.
What I did so far, was:
- download & install Tomcat 5.5
- make a dir under webapps\mycdcollection
- copy my xml files to webapps\mycdcollection
- make a dir webapps\mycdcollection\WEB-INF
- make a dir webapps\mycdcollection\WEB-INF\lib
- copy standard.jar & jstl.jar to BOTH webapps\mycdcollection\WEB-INF\lib as webapps\ROOT\WEB-INF\lib
Here are my questions:
- How should my web.xml in webapps\mycdcollection\WEB-INF look like?
- Should I precompile my jsp? If so, should there be a classes directory somehwere? How should I make my app know that there is a classes directory?
I'm sure I will have lots more of questions, but if you can get me on the way I'd be very thankful.hi,
u can interact with xml while in jsp. we have jstl (xml) tags to interact with the xml files.
use the jstl and copy the jar files neede for the jstl in to ur web app folder. u need to copy jstl.jar, standard.jar, jaxen.jar, and optionally (saxpath.jar and xalan.jar) based on the versions of the jstl ur using.
mail me at [email protected], if u have any problems.
Here, are some urls' go through with this,
http://www.roseindia.net/jstl/introduction.shtml
http://www-128.ibm.com/developerworks/java/library/j-jstl0318/
http://jcp.org/aboutJava/communityprocess/final/jsr052/index2.html
regards,
pavan -
I want to use ODI to read XML messages from JMS queue and then process it..
I want to use oracle ODI (Oracle Data Integrator) to read XML messages from JMS queue and then process it.. i also want to process and validate the data in it....
Could anyone please tell me the steps to achieve the same. I tried some ways which i got on OTN, but not able to implement it exactly...
As i m very new to ODI, it will be great if you provide detailed steps..
Thanks in advance for your help....Hi,
Were you able to do it? We are facing this same issue now and, despite the fact the docs say otherwise, it does not seem to be a trivial task.
TIA,
Tedi -
I am waiting to read in few different user actions. One of them is if they hit the "enter key" and nothing else. How can you check if the enter key has been pressed?
In java and I am reading the input in through a BufferedReaderWill it? Maybe you are right. I was justguessing.
It does when I read an empty line from a text file...
so why not from System.in? :)I was thinking it would buffer the input. It would return until it hit whatever triggers it to return. So it would return an empty line but perhaps not right away. I guess I could just try it, huh? -
Using an array to assign values to 36 radio buttons
Okay, here's another doozy for y'all.
As some of you know, I'm trying to create a character creation program for D&D. When we roll ability scores, we roll 3 sets of 6 rolls, rolling 4 six-sided dice, rerolling 1s and dropping the lowest number, then add the highest 3 rolled numbers together.
Great! Got that part done!
The next thing I'm having some issues with is transferring those numbers to radio button text property. What I have done is created a form that has the rolled values in listboxes so the user can see what was rolled. They can only choose one "set"
of rolls, so each set of 6 rolls is in a separate listbox. I can get the values from the listbox to an array, but I can't figure out how to get the values from an array to the radio buttons on the next form in the program.
The next form in the program has 6 group boxes, each labeled with a different ability score name (ie: Strength, Dexterity, etc.). Also in each group box are 6 radio buttons. Each radio button in each group box needs to have the same values. For example,
the first listed radio button in each group box needs to have the first value listed in the list box on the previous page. The second listed radio button in each group box needs to have the second value listed in the list box, and so on. I want it
to automatically load, but I'll settle for ANY load at the moment!
The other thing is that I don't want to write 36 lines of code for each group box's radio buttons! I would like to be able to populate the values with a loop. So, the biggest question is how to create an array containing all 36 radio buttons, then assign
my list box values to them according to their position in the multidimensional array.
Here is a tidbit so you'll have an idea what I'm looking at.
list box 1 has values 17, 18, 8, 12, 15, and 13. I want the radio buttons in each group box on the second form to be 17 for the 1st radio button, 18 for the 2nd radio button, 8 for the 3rd radio button, 12 for the 4th radio button, 15 for the 5th radio
button, and 13 for the 6th radio button.
Any ideas?The array of radio buttons:
radGr1_1
radGr1_2
radGr1_3
radGr1_4
radGr1_5
radGr1_6
radGr2_1
radGr2_2
radGr2_3
radGr2_4
radGr2_5
radGr2_6
radGr3_1
radGr3_2
radGr3_3
radGr3_4
radGr3_5
radGr3_6
radGr4_1
radGr4_2
radGr4_3
radGr4_4
radGr4_5
radGr4_6
radGr5_1
radGr5_2
radGr5_3
radGr5_4
radGr5_5
radGr5_6
radGr6_1
radGr6_2
radGr6_3
radGr6_4
radGr6_5
radGr6_6
Those listed with “radGr1” are in the first group box labeled grpST, “radGr2” are in the second group box labeled grpDX, and so on (grpCN, grpIQ, grpWS, grpCH). What I want the code to do is change the labels of the radio buttons so that the text displayed
in everything with a suffix of “_1” is filled with the first number in the selected listbox. For example, if I select the first list box, the other 2 are cleared and only the 6 numbers in the first one are used for the rest of the program. If those numbers
are 12, 13, 14, 15, 17, and 11, then everything with _1 at the end should have “12”, everything with _2 should have “13”, and so on. What I don’t want to have to do is initialize 36 elements, then have 6 different selections for each group box. I tried to
attach an image, but it wouldn’t let me…something about verifying my account or something…
Can I suggest a different layout? It seems like the status selection process is over-complicating the code... please consider this form layout:
Once the user has selected the set of rolls they want you use, you can then just work with that single listbox. The radio buttons let them select a particular stat and the listbox lets them select a value. The "<-" button then assigns
the selected value to the selected stat, and removes it from the listbox. The "->" button clears the selected stat and returns the value to the listbox. The code is something like:
Public Class Form1
Private Sub SetButton_Click(sender As Object, e As EventArgs) Handles SetButton.Click
If ChosenRollsListBox.SelectedIndex > -1 Then
Select Case True
Case StrRadioButton.Checked
If Not StrLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(StrLabel.Text)
End If
StrLabel.Text = ChosenRollsListBox.SelectedItem.ToString
ChosenRollsListBox.Items.RemoveAt(ChosenRollsListBox.SelectedIndex)
Case DexRadioButton.Checked
If Not DexLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(DexLabel.Text)
End If
DexLabel.Text = ChosenRollsListBox.SelectedItem.ToString
ChosenRollsListBox.Items.RemoveAt(ChosenRollsListBox.SelectedIndex)
Case ConRadioButton.Checked
If Not ConLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(ConLabel.Text)
End If
ConLabel.Text = ChosenRollsListBox.SelectedItem.ToString
ChosenRollsListBox.Items.RemoveAt(ChosenRollsListBox.SelectedIndex)
Case IntRadioButton.Checked
If Not IntLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(IntLabel.Text)
End If
IntLabel.Text = ChosenRollsListBox.SelectedItem.ToString
ChosenRollsListBox.Items.RemoveAt(ChosenRollsListBox.SelectedIndex)
Case WisRadioButton.Checked
If Not WisLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(WisLabel.Text)
End If
WisLabel.Text = ChosenRollsListBox.SelectedItem.ToString
ChosenRollsListBox.Items.RemoveAt(ChosenRollsListBox.SelectedIndex)
Case ChaRadioButton.Checked
If Not ChaLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(ChaLabel.Text)
End If
ChaLabel.Text = ChosenRollsListBox.SelectedItem.ToString
ChosenRollsListBox.Items.RemoveAt(ChosenRollsListBox.SelectedIndex)
End Select
End If
End Sub
Private Sub ClearButton_Click(sender As Object, e As EventArgs) Handles ClearButton.Click
Select Case True
Case StrRadioButton.Checked
If Not StrLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(StrLabel.Text)
StrLabel.Text = "_"
End If
Case DexRadioButton.Checked
If Not DexLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(DexLabel.Text)
DexLabel.Text = "_"
End If
Case ConRadioButton.Checked
If Not ConLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(ConLabel.Text)
ConLabel.Text = "_"
End If
Case IntRadioButton.Checked
If Not IntLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(IntLabel.Text)
IntLabel.Text = "_"
End If
Case WisRadioButton.Checked
If Not WisLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(WisLabel.Text)
WisLabel.Text = "_"
End If
Case ChaRadioButton.Checked
If Not ChaLabel.Text = "_" Then
ChosenRollsListBox.Items.Add(ChaLabel.Text)
ChaLabel.Text = "_"
End If
End Select
End Sub
End Class
This may not suit your requirements but I thought it was at least worth considering an alternate design that would be much easier to implement.
Reed Kimble - "When you do things right, people won't be sure you've done anything at all" -
How to getvalue from selected radio button
<table width="39%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40">
<input type="radio" name="radiobutton" value="proID" >
<strong>Product ID:
<input type="text" name="remProID" size="5" maxlength="5">
</strong></td>
</tr>
<tr>
<td>
<p> </p>
<p><strong>
<input type="radio" name="radiobutton" value="proDesc" >
Product Name:
<select name="remProName">
</select>
</strong></p>
<p> <strong> Product Description:</strong>
<select name="remProDesc">
</select>
</p>
</td>
</tr>
</table>Question: How to get the value from the textbox when the respective radio button is checked?
Thanksfor helping.If the radiobuttons are within a form, then I am certain you can replace the lines marked
<input type="radio" name="radiobutton" value="proID" > and
<input type="radio" name="radiobutton" value="proDesc" >
with
<input type="radio" name="radiobutton" value="proID" onClick="return onClickRadioBtn(this)">
and
<input type="radio" name="radiobutton" value="proDesc" onClick="return onClickRadioBtn(this)">
respectively.
You will then need to create the following JavaScript functions:
<script language="JavaScript">
function onClickRadioBtn(oRadioBtn)
if(oRadioBtn.value == "proID")
//Perform desired steps for ProID radio button
else if (oRadioBtn.value == "proDesc")
//Perform desired steps for ProDesc radio button
else
//Perform desired steps for a function call having
// neither values of the proID nor proDesc
return true;
</script>
Again, I am sure this solution works for objects within a <form name="xyz"...> html form. There is a possibility that this function call will work outside of a html form environment, but I simply can't recall implementing it in that fashion.
Hope this helps. -
Filtering responses in different text fields from different radio buttons.
Once again I need some guidance with my form please.
I have a form (audit report) with numerous radio buttons with 4 options each, NA, CN, PC and C.
Each represents a different answer to the question associated with the radio button.
This answer this then passes through to a text field next to the radio buttons.
In turn at the beginning of my form I have an executive brief giving a run down on findings from the different questions asked. These are a reflection of the text fields associated with the radio buttons.
These are represented as 2 text fields namely, Non-compliant (NC), partial – compliant (PC).
What I am getting now is a whole lot of “null” answers that change when one of the radio buttons are selected and reflects that answer associated with the selection, both NC and PC text fields are the same and I then have to edit it and delete the PC from the NC section and the same for the PC section.
What I would like to happen is that all the “nulls” are hidden and only when the answer representing the NC or PC buttons are selected, that those answer get represented through to the Non-compliant (NC), partial- compliant (PC) text fields in my executive brief. IE some sort of filter for each text filed that only displays the NC or PC answers.
Any help or guidance will be appreciated.I will explain this through an example.
In my application I have created two Select Lists.
The first select list is a select list with a submit
P3_X allows selection of 1,2,3
The page branch sets the value of P3_X with &P3_X. so that way the second select list knows what value it will be using.
The second select list P3_Y is a dynamic query that says
Select SCOL d, SCOL r from TEST1 where FCOL=:P3_X
If you were to have a third select list you would make the second Select List also a submit and have the page branch also set P3_Y with &P3_Y.
The third Select list would say select from where item=:P3_Y
Does this answer your question? -
How use PHP to read image files from a folder and display them in Flex 3 tilelist.
Hello. I need help on displaying images from a folder dynamically using PHP and display it on FLEX 3 TileList. Im currently able to read the image files from the folder but i don't know how to display them in the TileList. This is my current code
PHP :
PHP Code:
<?php
//Open images directory
$imglist = '';
$dir = dir("C:\Documents and Settings\april09mpsip\My Documents\Flex Builder 3\PHPTEST\src\Assets\images");
//List files in images directory
while (($file = $dir->read()) !== false)
if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
echo "filename: " . $file . "\n";
$dir->close();
?>
FLEX 3 :
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="pic.send();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ItemClickEvent;
import mx.rpc.events.ResultEvent;
public var image:Object;
private function resultHandler(event:ResultEvent):void
image = (event.result);
ta1.text = String(event.result);
private function faultHandler(event:FaultEvent):void
ta1.text = "Fault Response from HTTPService call:\n ";
]]>
</mx:Script>
<mx:TileList x="31" y="22" initialize="init();" dataProvider = "{image}" width="630" height="149"/>
<mx:String id="phpPicture">http://localhost/php/Picture.php</mx:String>
<mx:HTTPService id="pic" url="{phpPicture}" method="POST"
result="{resultHandler(event)}" fault="{faultHandler(event)}"/>
<mx:TextArea x="136" y="325" width="182" height="221" id="ta1" editable="false"/>
<mx:Label x="136" y="297" text="List of files in the folder" width="182" height="20" fontWeight="bold" fontSize="13"/>
</mx:Application>
Thanks. Need help as soon as possbile. URGENT.i have made some changes, in the php part too, and following is the resulting code( i tried it, and found that it works.):
PHP Code:
<?php
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<root>
<images>
<?php
//Open images directory
$dir = dir("images");
//List files in images directory
while (($file = $dir->read()) !== false)
if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
echo "<image>" . $file . "</image>"; // i expect you to use the relative path in $dir, not C:\..........
//$dir->close();
?>
</images>
</root>
Flex Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="callPHP();">
<mx:Script>
<![CDATA[
import mx.rpc.http.HTTPService;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ItemClickEvent;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var arr:ArrayCollection = new ArrayCollection();
private function callPHP():void
var hs:HTTPService = new HTTPService();
hs.url = 'Picture.php';
hs.addEventListener( ResultEvent.RESULT, resultHandler );
hs.addEventListener( FaultEvent.FAULT, faultHandler )
hs.send();
private function resultHandler( event:ResultEvent ):void
arr = event.result.root.images.image as ArrayCollection;
private function faultHandler( event:FaultEvent ):void
Alert.show( "Fault Response from HTTPService call:\n " );
]]>
</mx:Script>
<mx:TileList id="tilelist"
dataProvider="{arr}">
<mx:itemRenderer>
<mx:Component>
<mx:Image source="images/{data}" />
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:Application> -
Reading dilimited input from a text file with tokenizer
i am trying to read in a text file with the following structure: 2 integers on each line with comma as the delimitor.
i am using the BufferedReader stream and Tokenizer to detect ",".
try {
BufferedReader in = new BufferedReader(new FileReader(filename));
//read in the data file
while ((s = in.readLine())!= null) {
int i = 0;
for (i = 0; i < 100; i++) {
t = new StringTokenizer(s,",");
A1 = Integer.parseInt(t.nextToken());
catch (IOException e) {System.err.println(e);}
When i print out A1[i], it only reads the last line of the text file. Please tell me what's wrong.
Also i'd really like A1[i] to store the integer before the comma and another array A2[i] to store the integer after the comma. Please help.
Thanks.
p.s. A1 and A2 are arrays...when i previewd message in Netscape 7 it left out the brackets and the index....What is the for i loop for? If it is to read the next line from the file, then the while loop has taken care of it. Other than this there should be no problem with the rest of the code.
Just add another line to store the next token into A2. -
Using UME to read binary attribute from LDAP (objectSID)
Hi,
I am trying to read the ObjectSID of an LDAP user (from MS Active directory) from an IUser object. This attribute is binary retrieved from the LDAP and if I defined a normal extra attribute in the datasourceconfiguration file and retrieve it as a String the value is wrong.
So my question is how can I define this as a binary attribute?
From the file C:\usr\sap\EWD\JC00\j2ee\configtool\dataSourceConfiguration.dtd you get the specification of the xml format for the datasourceconfiguration.
The Attribute element has the following specification:
<!ATTLIST attribute name CDATA #REQUIRED populateInitially (true|false) #IMPLIED
readonly (true|false) #IMPLIED
type (string|blob) #IMPLIED
cacheTime CDATA #IMPLIED>
Since you have type here, I tried setting it to blob under the user object as such:
For user:
<attribute name="guid" type="blob" populateInitially="true"/>
For attribute mapping:
<attribute name="guid">
<physicalAttribute name="objectSid"/> </attribute>
However, I still get the following error when calling
iuser.getBinaryAttribute(UME_NAMESPACE,UME_GUID_NAME ):
Caused by: com.sap.security.api.UMRuntimeException: String attribute "com.sap.security.core.usermanagement"-->"guid" must be read using IPrincipal.getAttribute(com.sap.security.core.usermanagement,guid)
at com.sap.security.core.imp.AbstractPrincipal.getBinaryAttribute(AbstractPrincipal.java:300)
at com.sap.security.core.imp.UserWrapper.getBinaryAttribute(UserWrapper.java:261)
at com.bouvet.portal.login.UserIntegrityLoginModule.getStatoilUser(UserIntegrityLoginModule.java:430)
at com.bouvet.portal.login.UserIntegrityLoginModule.login(UserIntegrityLoginModule.java:255)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:69)
... 41 more
This error indicates that the attributes is a string and not a binary attribute.
Anyone?Create OSS and initial message is that this is not supported eventhough some of the configuration files point that direction. It's really easy to implement so maybe if I am lucky I'll get a hotfix.
Dagfinn
btw the field was objectGUID not objectSID -
Use JNI to Read C++ Structure from a Socket
Hi all,
I'm new to JNI and I have a problem for reading a tcp stream from a C++ server in my Java client.
Does someone now if it's possible to use JNI to "cast" my tcp stream (array of byte) in a java structure (class of data) ?
I've heard about Struct class in Javolution, but it seems to work just for UDP. Should it works for TCP ?
Another possibility is to read byte per byte.
Thank you a lot for any help.
Jeremie.Suppose I have a String representation of hexadecimal
code, How to convert this to hexadecimal code like
String code =
"68FF74AEE3FA825627E1AA58E29D6863C148C735";
I have to convert code to original hexadecimal code.
How can I convert this one.
Any help from you will be great to me.
Thank you
MouliDo you mean how to convert that String into a byte array containing the values represented by the String? If so, this code might work.
String code = "FF74AEE3FA825627E1AA58E29D6863C148C735";
byte[] bytes = new byte[code.length()/2];
for(int i=0;i<code.length();i+=2) {
bytes[ i/2 ] = (byte) (Integer.parseInt(code.substring(i,i+2),16));
System.out.println(bytes[i/2]);
[/code -
Include using jsp:include for a file from the docroot directory.
Hello,
I try to include one file from the doocroot but only can import files from the context (War deployed).
when I put
<jsp:include page="/foo.htm">
to include this file: http://www.mydomain.com/foo.html
it try to show this file: http://www.mydomain.com/mycontext/foo.html
it puts ever the context before the name of my file.
How can I include this file.
Thanks
PD: obviously 'foo.html' is in the doocroot.From within a JSP you have a reference to a PageContext called pageContext. This has a method getServletContext(). From the ServletContext you can find the real path the servlet lives in. So...
File basePath = new File(pageContext.getServletContext().getRealPath("/"));Now basePath contains your path $Catalina/webapps/webservices. Then it's just a matter of working relative to that, e.g.:
File usersFile = new File(basePath, "users.txt");
Maybe you are looking for
-
ITunes Cannot be open with error message
hi, I having this problem, when i try to open it show me: Runtime error. pls help
-
CDC for Oracle Continually goes to Aborted State - SQL Server 2012
I am setting up a test environment for CDC with an Oracle system. I have everything set up to the point where logs are being read and data appears to be getting added to the CDC tables in SQL Server. However, at different times during the day, the
-
RFC monitoring in CCMS if the patch level R/3 release 4.6C ?
Hi all, FOr RFC monitoring is possible in CCMS if the patch level R/3 release 4.6C ? ST-PI 2005_1_46C ST-A/PI 01M_R3_46C SAP_NOTES 46C SAP_HR 46C SAP_BASIS 46C SAP_APPL 46C SAP_ABA 46C Please let me know the requirement
-
Dear Expert, I make the tax as conditions that comes in the condition tab not in the invoice tab of the PO and it comes right now when i go to make invoice this tax conditions doesn't comes at the invoice Any help for this issue
-
Pushing Data from Parent to children
Hi, my users need to put a data on a parent account and not level zero and I need to think of a way to push the value down (all of it to 1 child or the average to all childs) TRAVEL 100 acc_62110 100 acc_62115 #mi or TRAVEL 100 acc_62110 50 acc_62115