File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes xml and base64 encode help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml and base64 encode help" Watch "xml and base64 encode help" New topic

xml and base64 encode help

Zoe Peng
Ranch Hand

Joined: Nov 27, 2000
Posts: 112
I have a question here. Please help.
// login jsp page generate a wml file and get the user name(already known)/password(user type in) to re-submit to server and doing the basic authentication
// the username and password need to be encode with base64 to submit this query
// the encode mechaism needs to be done in the client side. (so, I won't be able to write a servlet to encoding it)
// the simulator won't be able to use <meta> tag (so, I can't use this way to set the header)
How can I submit the username and password with base64 encode?? Does it look like this? <?xml version="1.0" encoding="base64"?>
I've been check with some rfc file, can I use UTF-16 to instead(still fail this way)?
<%@ page contentType="text/vnd.wap.wml"%>
<?xml version="1.0" encoding="base64"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http:///">
<card id="login" title="Login Screen">
<p align="left">
authentication test in jsp/wml<br/>
Login name:<input name="LogonName" type="text" emptyok="false" value="<%= request.getRemoteUser() %>" />
Password:<input name="LogonWord" type="text" emptyok="false" value="" />

<do type="accept" label="Next">
<go href="http://localhost/Services_app/login3.jsp" method="get">
<postfield name="username" value="$(LogonName)" />
<postfield name="password" value="$(LogonWord)" />
Zoe Peng
Ranch Hand

Joined: Nov 27, 2000
Posts: 112
I found the solution. Thanks.
I agree. Here's the link:
subject: xml and base64 encode help
It's not a secret anymore!