Form is submitting empty data - coldfusion

We have a site to where there are a lot of different forms that are submitting the same data format. (previous developer did it this way, why I would never know) My question is, can I find out which page submitted this form data? So I can go into the file and fix the issue? Also, I understand that their is a lot of old code, (HTML 4) I'm just trying to solve the problem so I can then go back and update it to (HTML 5). Once it's fixed.
I have 2 assumptions to why the data can be submitting blank results:
There is no client or server-side validation going on.
It's possible a spam bot is bypassing the validation and just submitting blank data to the emails.
I went to one file that I believed was one of the problems to the issue, and modified the following code to try and stop the blank form submission results from happening. Would this still be vulnerable to blank submission results?
Form:
<cfparam name="form.firstName" default="">
<cfparam name="form.lastName" default="">
<cfparam name="form.email" default="">
<cfparam name="form.subject" default="">
<cfparam name="form.comments" default="">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example form problem</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="viewport" content="initial-scale=1">
<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" />
<link rel="shortcut icon" property="icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="//cloud.typography.com/7136474/785948/css/fonts.css" />
<link rel="stylesheet" href="css/style.css" TYPE="text/css">
<link rel="stylesheet" href="css/online-reservations.css" TYPE="text/css">
<link href="css/flexnav.css" media="screen, projection" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="js/jquery.flexnav.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
// initialize FlexNav
$(".flexnav").flexNav();
});
</script>
</head>
<body id="contact">
<div id="pageHeader">
<ul>
<li class="right">
<br/>
<div class="login" style="margin-top:11px;"><span>LOGIN</span></div>
</li>
</ul>
</div><!-- END pageHeader-->
<!-- Nav -->
<div class="nav-wrapper">
<cfinclude template="includes/mobile-menu.cfm" >
</div>
<!-- /Nav -->
<br/><br/>
<br/><br/>
<br/><br/>
<div class="full-width-light-bg blue little">
<div class="page-width light-bg">
<h1 class="skinny">Contact Us</h1>
<br/>
<form name="ContactForm" action="_email_results.cfm" method="POST">
<div id="frmReservation">
<div class="input-wrapper">
<span>First Name</span>
<input name="FirstName"
message="Please enter your first name"
type="Text"
maxlength="50"
id="firstName"
required
</div><!--/input-wrapper-->
<div class="input-wrapper">
<span>Last Name</span>
<input name="LastName"
message="Please enter your last name"
type="Text"
maxlength="50"
id="lastName"
required
</div><!--/input-wrapper-->
<div class="input-wrapper">
<span>E-mail Address</span>
<input name="email"
message="Please enter a valid email address"
type="email"
maxlength="50"
id="email"
validate="Email"
required
</div><!--/input-wrapper-->
<div class="input-wrapper">
<span>Subject</span>
<input
name="Subject"
id="subject"
type="Text"
required >
</div><!--/input-wrapper-->
<div class="input-wrapper">
<span>Comment</span>
<textarea name="Comments" wrap="hard"></textarea>
</div><!--/input-wrapper-->
<center><br/>
<input
class="redButton"
id="submitButton"
Type=submit
Value="Send"
title="Submit Contact Us Form">
</center>
<cfinclude template="../../cfformprotect/cffp.cfm">
</div><!--/#frmReservation-->
</form>
<br class="clear" /><br/>
</div><!--END page-width light-bg-->
</div><!--END full-width-light-bg little-->
<script type="text/javascript" src="js/toggle-menu.js"></script>
<script type="text/javascript">
var firstName = document.getElementById('firstName');
var lastName = document.getElementById('lastName');
var email = document.getElementById('email');
var subject = document.getElementById('subject');
var submitButton = document.getElementById('submitButton');
submitButton.addEventListener('click', function(e){
//console.log('test');
if(firstName.value == '' || lastName.value == '' || email.value == '' || subject.value == ''){
alert('Please fill out all fields.');
// Prevent form submission
e.preventDefault();
}
});
</script>
</body>
</html>
Form Data:
<cfparam name="form.firstName" default="">
<cfparam name="form.lastName" default="">
<cfparam name="form.email" default="">
<cfparam name="form.subject" default="">
<cfparam name="form.comments" default="">
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="3; url=index.cfm">
<title>Thank you for submitting your notes</title>
<link rel="stylesheet" type="text/css" href="//cloud.typography.com/7136474/785948/css/fonts.css" />
<link rel="stylesheet" href="css/style.css" TYPE="text/css">
</head>
<body id="contact">
<br/><br/>
<h1 align="center" class="color-white">Thank You For Contacting Us!</h1>
<div align="center" class="color-white">You will be re-directed</div>
<CFOUTPUT>
<CFSAVECONTENT variable="EmailContent">
<font Face="arial,helvetica" size="1">
<table bgcolor="white" width="600" style="font-family:'Arial',Helvetica;font-size:11px;">
<tr bgcolor="BAD8EA">
<td colspan=3>Center Reservation</td>
</tr>
<tr>
<td width="150">Date: #DateFormat(NOW())# at #Timeformat(NOW())#</td>
<td> </td>
</tr>
<tr bgcolor="e43226">
<td colspan=3></td>
</tr>
<tr>
<td>First Name:</td>
<td>#form.firstName#</td>
</tr>
<tr bgcolor="e43226">
<td colspan=3></td>
</tr>
<tr>
<td>Last Name:</td>
<td>#form.lastName#</td>
</tr>
<tr bgcolor="e43226">
<td colspan=3></td>
</tr>
<tr>
<td>Email Address</td>
<td>#form.email#</td>
</tr>
<tr bgcolor="e43226">
<td colspan=3></td>
</tr>
<tr>
<td>Subject:</td>
<td>#form.subject#</td>
</tr>
<tr bgcolor="e43226">
<td colspan=3></td>
</tr>
<tr>
<td>Comments:</td>
<td>#form.comments#</td>
</tr>
<tr bgcolor="e43226">
<td colspan=3></td>
</tr>
</table>
</font>
</CFSAVECONTENT>
</CFOUTPUT>
<cfif form.firstName EQ '' || form.lastName EQ '' || form.email EQ '' || form.subject EQ ''>
<!--- Do nothing do not email the results --->
<cfelse>
<!--- Submit the form --->
<cfmail to ="test#test.com"
cc ="test#test.com"
bcc =""
from ="#AppVars.mailfrom#"
server ="#AppVars.mailserver#"
type ="html"
subject ="Form issue">
#EmailContent#
</cfmail>
</cfif>
</body>
</html>

This is more of a long comment than an answer, but here goes. Consider using CSRF tokens.
The page that has form should have
<input name="token" value="#csrfToken#" type="hidden" />
The response page should have
<cfif !CSRFverifyToken(form.token)>
<p>I am going going to run this page</p>
<cfexit>
</cfif>
This might help take care of some of the attacks
Cross Site Request Forgery also known as a one-click attack or session riding and abbreviated as CSRF (sometimes pronounced sea-surf) or XSRF, is a malicious attack to exploit a website's trust in a user's browser. The attacker tries to get the user's own web browser (or web application) to execute unwanted commands.
For more info on CSRF: https://stackoverflow.com/tags/csrf/info

Direct Answer: to work out what page submitted the data you would need to store cgi.http_referrer along with the form.
I would also suggest CSRF answer above, but your question asks how to find out what form submitted, not if it did.
I'd also set your content-security-policy headers on your webserver to limit sources of information.

Related

I have been trying to make an error handling on Coldfusion, everything is working good but I am not able to get the current session username

Application.cfm
<cfapplication name="AppError" clientmanagement="Yes" sessionmanagement="Yes"
clientstorage="cookie">
<cferror type="exception" template="ExpressError.cfm" exception="expression">
<cferror type="exception" template="DatabaseError.cfm" exception="database">
ExpressError.cfm
<cfoutput>
Sorry! Internal Error Occurred!
<cfsavecontent variable="errortext">
<div class="container">
<table class="err">
<tr>
<th>URL</th><td>#cgi.server_name##cgi.script_name#</td>
</tr>
<tr>
<th>Message</th><td>#Error.message#</td>
</tr>
<tr>
<th>Diagnostics</th><td>#Error.Diagnostics#</td>
</tr>
<tr>
<th>Template</th><td>#Error.TEMPLATE#</td>
</tr>
</table>
</div>
</cfsavecontent>
<cfmail to="xxx#xxx.com" from="yyy#yyyy.com" subject="Error : #Error.message#" type="html">
<HTML>
<head>
<style type="text/css">
<cfinclude template="Style/errorstyle.css">
</style>
</head>
<body>
#errortext#
</body>
</HTML>
</cfmail>
</cfoutput>
DatabaseError.cfm
<cfoutput>
Sorry! Internal Error Occurred!
<cfsavecontent variable="errortext">
<div class="container">
<table class="err">
<tr>
<th>Application</th><td>#elmsapp#</td>
</tr>
<tr>
<th>URL</th><td>#cgi.server_name##cgi.script_name#</td>
</tr>
<tr>
<th>Message</th><td>#Error.message#</td>
</tr>
<tr>
<th>Diagnostics</th><td>#Error.Diagnostics#</td>
</tr>
<tr>
<th>Template</th><td>#Error.TEMPLATE#</td>
</tr>
<tr>
<th>Sql</th><td>#Error.RootCause.Sql#</td>
</tr>
<tr>
<th>DataSource</th><td>#Error.RootCause.DataSource#</td>
</tr>
<tr>
<th>RemoteAddress</th><td>#Error.RemoteAddress#</td>
</tr>
</table>
</div>
</cfsavecontent>
<cfmail to="xxx#xxx.com" from="yyy#yyyyy.com" subject="Error: #Error.message#" type="html">
<HTML>
<head>
<style type="text/css">
<cfinclude template="Style/errorstyle.css">
</style>
</head>
<body>
#errortext#
</body>
</HTML>
</cfmail>
</cfoutput>
test.cfm
<cfoutput>#sdfssfsdf#</cfoutput>
user.cfm
<cfoutput> #trim(session.auth_user)# </cfoutput>
So when i run test.cfm, i am getting a correct email saying "Variable SDFSSFSDF is undefined." but when i run user.cfm, i am getting an email saying "Element AUTH_USER is undefined in SESSION.".
Point is when i delete application.cfm, user.cfm page gives the correct username of the session but with application.cfm in place...it gives an error. I think i need to define the sessiom.auth_user but how and where is the question.
Would appreciate if someone could please help me out. Thanks

How use TemplateView with 2 methods (get and post)

I am trying to use Templateview in Django to render a page with options for both adding to the database and retrieving some info from the database and displaying it. I am basing it on the tutorial at https://www.youtube.com/watch?v=VxOsCKMStuw
views.py:
class TestView(TemplateView):
template_name = 'app/sensor_name_tmpl.html'
def get(self, request):
form = SensorForm()
posts = Sensor.objects.all()
args = {'form': form, 'posts': posts}
return render(request, self.template_name, args)
def post(self, request):
form = SensorForm(request.POST)
if form.is_valid():
form.save()
text = form.cleaned_data['post']
form = SensorForm()
return redirect('sensor_name_tmpl:sensor_name_tmpl')
args = {'form': form, 'text': text}
return render(request, self.template_name, args)
urls.py:
urlpatterns = [
path('', views.index, name='index'),
url(r'^form1/$', views.get_sensor_name, name='GiveSensorName1'),
#url(r'^form2/$', TestView.as_view(), name='sensor_name_tmpl.html'),
path('form2/', TestView.as_view(), name='app/sensor_name_tmpl.html'),
url(r'^nested_admin/', include('nested_admin.urls')),
]
HTML template:
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$('#toggle').click(function() {
$('form').toggle('slow');
});
</script>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<title>Hello world!</title>
</head>
<body>
<h3 class="text-success">Add Sensor</h3>
<br>
<!-- <form style="display:none;" method="post">-->
<form method="post">
{% csrf_token %}
<div class="row align-items-center">
<div class="col-sm-8">
<table>
{{ form1.as_table}}
</table>
<div class="mx-sm-2">
<input type="submit" value="Submit">
</div>
<br>
<br>
<h3 class = "text-success">Add Sensor View</h3>
<table>
{{ form2.as_table}}
</table>
<div class="mx-sm-2">
<input type="submit" value="Submit">
</div>
<br>
<br>
<h3 class="text-success">View Sensors</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Sensor ID</th>
<th scope="col">Sensor Name</th>
</tr>
</thead>
<tbody>
{%for obj in obj%}
<tr>
<td>{{obj.sensor_id}}</td>
<td>{{obj.sensor_name}}</td>
<!-- <th scope="row">1</th>-->
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div>
</form>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
</body>
</html>
The page renders the template but doesn't populate it with either the formfields or the data from the database.
The problem was with the HTML template where form1 and form2 have now been replaced with form and "obj" in the for loop has been replaced with "posts". The template now looks as follows:
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$('#toggle').click(function() {
$('form').toggle('slow');
});
</script>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<title>Hello world!</title>
</head>
<body>
<h3 class="text-success">Add Sensor</h3>
<br>
<!-- <form style="display:none;" method="post">-->
<form method="post">
{% csrf_token %}
<div class="row align-items-center">
<div class="col-sm-8">
<table>
{{ form.as_table}}
</table>
<div class="mx-sm-2">
<input type="submit" value="Submit">
</div>
<br>
<br>
<h3 class = "text-success">Add Sensor View</h3>
<table>
{{ form.as_table}}
</table>
<div class="mx-sm-2">
<input type="submit" value="Submit">
</div>
<br>
<br>
<h3 class="text-success">View Sensors</h3>
<table class="table">
<thead>
<tr>
<th scope="col">Sensor ID</th>
<th scope="col">Sensor Name</th>
</tr>
</thead>
<tbody>
{%for obj in posts%}
<tr>
<td>{{obj.sensor_id}}</td>
<td>{{obj.sensor_name}}</td>
<!-- <th scope="row">1</th>-->
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div>
</form>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
</body>
</html>
Being a beginner Django Developer, I will suggest that it is actually not advisable to use TemplateView class for any kind updating of objects or if your template is having a form. You can read more about this here.

JQUERY UI datepicker not working when applied to multiple ids

I am trying to integrate JQUERY datepicker with the following form. I can't seem to figure out why the datepicker doesn't work no matter what I try. I have looked everywhere on stack overflow and none of the solutions worked.
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<link href="manage.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/base/jquery-ui.css" type="text/css" media="all">
<script>
$(document).ready(function() {
$(function() {
$( "#startdate" , "#enddate" ).datepicker( {dateFormat: 'yyyy-mm-dd' } );
});
});
</script>
</head>
<body>
<form action="" method="POST" name="form1">
<label>
<b>Start Date</b>
<span class="style1">*</span> (format YYYY-MM-DD)
</label>
<br />
<input type="text" name="time_start" id="startdate"/>
<br/>
<br/>
**strong text**
<label>
<b>End Date</b>
<span class="style1">*</span> (format YYYY-MM-DD)
</label>
<br />
<input type="text" name="time_end" id="enddate"/>
<br/>
<br/>
</form>
</body>
</html>
just replace $( "#startdate" , "#enddate" ) with $( "#startdate, #enddate" ). Your code will work
I just added class to the <input> field and use it in the script for multiple datepick. And reduced yyyy to yy for the required format. The yyyy will give you 20162016-12-07
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/base/jquery-ui.css" type="text/css" media="all">
<script>
$(document).ready(function() {
$(function(){$('.datepick').datepicker( {dateFormat: 'yy-mm-dd' } ); });
});
</script>
</head>
<body>
<form action="" method="POST" name="form1">
<label>
<b>Start Date</b>
<span class="style1">*</span> (format YYYY-MM-DD)
</label>
<br />
<input type="text" name="time_start" class="datepick" id="startdate"/>
<br/>
<br/>
<label>
<b>End Date</b>
<span class="style1">*</span> (format YYYY-MM-DD)
</label>
<br />
<input type="text" name="time_end" class="datepick" id="enddate"/>
<br/>
<br/>
</form>
</body>
</html>

wso2 api manager does not support URL pattern demo/*.action

I published my API at WSO2 API Publisher with url pattern
demo/test.action which will return a json object.
From API Store, when I 'try it out' from API console, it gives response code 200 which means it worked successfully.
But from the 'Response Body' it gives me,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>WSO2 API Manager</title>
<link href="../admin/css/global.css" rel="stylesheet" type="text/css" media="all"/>
<link href="../styles/css/main.css" rel="stylesheet" type="text/css" media="all"/>
<link href="../dialog/css/jqueryui/jqueryui-themeroller.css" rel="stylesheet" type="text/css"
media="all"/>
<link href="../dialog/css/dialog.css" rel="stylesheet" type="text/css" media="all"/>
<link rel="stylesheet" href="../admin/css/carbonFormStyles.css">
<!--[if gte IE 8]>
<link href="../dialog/css/dialog-ie8.css" rel="stylesheet" type="text/css" media="all"/>
<![endif]-->
<!--[if gte IE 7]>
<link href="../dialog/css/dialog-ie8.css" rel="stylesheet" type="text/css" media="all"/>
<![endif]-->
<link rel="icon" href="../admin/images/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="../admin/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="../admin/js/jquery-1.6.3.min.js"></script>
<script type="text/javascript" src="../admin/js/jquery.form.js"></script>
<script type="text/javascript" src="../dialog/js/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="../admin/js/jquery.cookie.js"></script>
<script type="text/javascript" src="../admin/js/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="../admin/js/jquery.ui.widget.min.js"></script>
<script type="text/javascript" src="../admin/js/jquery.ui.tabs.min.js"></script>
<script type="text/javascript" src="../admin/js/main.js"></script>
<script type="text/javascript" src="../admin/js/WSRequest.js"></script>
<script type="text/javascript" src="../admin/js/cookies.js"></script>
<script type="text/javascript" src="../admin/js/customControls.js"></script>
</head>
<script type="text/javascript">
if(getCookie('region1_configure_menu') == null){
setCookie('region1_configure_menu', 'none');
}
if(getCookie('region3_registry_menu') == null){
setCookie('region3_registry_menu', 'none');
}
if(getCookie('region4_monitor_menu') == null){
setCookie('region4_monitor_menu', 'none');
}
if(getCookie('region5_tools_menu') == null){
setCookie('region5_tools_menu', 'none');
}
</script>
<body>
<noscript>
<div class="something-wrong">
<div class="title">JavaScript is disabled on your browser</div>
<div class="content">Please enable JavaScript or upgrade to a JavaScript-capable browser to use WSO2 Products.</div>
</div>
</noscript>
<!--[if lte IE 6]>
<div class="something-wrong">
<div class="title">Did you know that your Internet Explorer is out of date?</div>
<div class="content">To get the best possible experience using our website we recommend that you upgrade to a newer version.</div>
</div>
<![endif]-->
<div id="dcontainer"></div>
<script type="text/javascript" src="../dialog/js/dialog.js"></script>
<!-- JS imports for collapsible menu -->
<script src="../yui/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>
<script src="../yui/build/animation/animation-min.js" type="text/javascript"></script>
<script src="../admin/js/template.js" type="text/javascript"></script>
<script src="../yui/build/yahoo/yahoo-min.js" type="text/javascript"></script>
<script src="../yui/build/selector/selector-min.js" type="text/javascript"></script>
<table id="main-table" border="0" cellspacing="0">
<tr>
<td id="header" colspan="3">
<!--[IF IE 7]>
<style>
div#header-div div.right-links{
position:absolute;
}
</style>
<![endif]-->
<div id="header-div">
<div class="right-logo">Management Console</div>
<div class="left-logo">
<img src="../admin/images/1px.gif" width="300px" height="32px"/>
</div>
<div class="middle-ad">
</div>
<div class="header-links">
<div class="right-links">
<ul>
<li class="right">
Sign-in
</li>
<li class="middle">|</li>
<li class="middle">
<a target="_blank" href="https://docs.wso2.com/display/AM190/WSO2+API+Manager+Documentation">Docs</a>
</li>
<li class="middle">|</li>
<li class="left">
<a target="_blank" href="../product/about.html">About</a>
</li>
</ul>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td class="vertical-menu-container" id="vertical-menu-container" style="display:none;">
<div id="menu-panel-button0"></div>
<div id="menu-panel-button1" class="menu-panel-buttons"></div>
<div id="menu-panel-button2" class="menu-panel-buttons"></div>
<div id="menu-panel-button3" class="menu-panel-buttons"></div>
<div id="menu-panel-button4" class="menu-panel-buttons"></div>
<div id="menu-panel-button5" class="menu-panel-buttons"></div>
<div id="menu-panel-button_dummy" style="display:none"></div>
</td>
<td id="menu-panel" valign="top">
<table id="menu-table" border="0" cellspacing="0">
<tr>
<td id="region1">
<div id="menu"> <ul class="main"><li>Home</li><li id="region1_manage_menu" class="menu-header" onclick="mainMenuCollapse(this.childNodes[0])" style="cursor:pointer"><img src="../admin/images/up-arrow.gif" class="mMenuHeaders" id="region1_manage_menu"/>Manage</li><li class="normal"><ul class="sub"></ul></li> </ul></div>
</td>
</tr>
<tr>
<td id="region2">
<div id="menu"> <ul class="main"> </ul></div>
</td>
</tr>
<tr>
<td id="region3">
<div id="menu"> <ul class="main"> </ul></div>
</td>
</tr>
<tr>
<td id="region4">
<div id="menu"> <ul class="main"> </ul></div>
</td>
</tr>
<tr>
<td id="region5">
<div id="menu"> <ul class="main"> </ul></div>
</td>
</tr>
<tr>
<td><img src="../admin/images/1px.gif" width="225px" height="1px"/></td>
</tr>
</table>
</td>
<td id="middle-content">
<table id="content-table" border="0" cellspacing="0">
<tr>
<td id="page-header-links">
<table class="page-header-links-table" cellspacing="0">
<tr>
<td class="breadcrumbs">
<table class="breadcrumb-table" cellspacing="0">
<tr>
<td>
<div id="breadcrumb-div"></div>
</td>
</tr>
</table>
</td>
<td class="page-header-help"><a href="./docs/userguide.html"
target="_blank">Help</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="body">
<img src="../admin/images/1px.gif" width="735px" height="1px"/>
<script type="text/javascript">
var msgId;
msgId = 'MSG14563839263210.8448934992899123';
</script>
<script type="text/javascript">
function doValidation() {
var reason = "";
var userNameEmpty = isEmpty("username");
var passwordEmpty = isEmpty("password");
if (userNameEmpty || passwordEmpty) {
CARBON.showWarningDialog('Please enter a valid user name and a password.');
document.getElementById('txtUserName').focus();
return false;
}
return true;
}
</script>
<script type="text/javascript">
function getSafeText(text){
text = text.replace(/</g,'<');
return text.replace(/>/g,'&gt');
}
function checkInputs(){
var loginForm = document.getElementById('loginForm');
var backendUrl = document.getElementById("txtbackendURL");
var username = document.getElementById("txtUserName");
backendUrl.value = getSafeText(backendUrl.value);
username.value = getSafeText(username.value);
loginForm.submit();
}
</script>
<div id="middle">
<table cellspacing="0" width="100%">
<tr>
<td>
<div id="features">
<table cellspacing="0">
<tr class="feature feature-top">
<td>
<a target="_blank" href="https://docs.wso2.com/display/AM190/WSO2+API+Manager+Documentation"><img src="../admin/images/user-guide.gif"/></a>
</td>
<td>
<h3><a target="_blank" href="https://docs.wso2.com/display/AM190/WSO2+API+Manager+Documentation">User Guide</a></h3>
<p>WSO2 Carbon user guide.</p>
</td>
</tr>
<tr class="feature">
<td>
<a target="_blank" href="http://wso2.org/forum/187"><img
src="../admin/images/forum.gif"/></a>
</td>
<td>
<h3><a target="_blank" href="http://wso2.org/forum/187">Forum</a>
</h3>
<p>The interactive message board for sharing information, questions and comments about WSO2 products.</p>
</td>
</tr>
<tr class="feature">
<td>
<a target="_blank"
href="https://wso2.org/jira/browse/APIMANAGER"><img
src="../admin/images/issue-tracker.gif"/></a>
</td>
<td>
<h3><a target="_blank"
href="https://wso2.org/jira/browse/APIMANAGER">
Issue Tracker</a></h3>
<p>Users are encouraged to report issues & suggest improvements using the JIRA issue tracker. In addition, users can observe the status of the reported issues in progress.</p>
</td>
</tr>
<tr class="feature">
<td>
<a target="_blank" href="http://wso2.org/mail"><img
src="../admin/images/mailing-list.gif"/></a>
</td>
<td>
<h3><a target="_blank" href="http://wso2.org/mail">
Mailing Lists</a></h3>
<p>Report issues, provide feedback & get help from our mailing lists.</p>
</td>
</tr>
</table>
</div>
</td>
<td width="20%">
<div id="loginbox">
<h2>Sign-in</h2>
<form action='../admin/login_action.jsp' method="POST" onsubmit="return doValidation();" target="_self" onsubmit="checkInputs()">
<table>
<tr>
<td>
<label for="txtUserName">Username</label>
</td>
<td>
<input type="text" id="txtUserName" name="username"
class="user" tabindex="1" autocomplete="off" />
</td>
</tr>
<tr>
<td>
<label for="txtPassword">Password</label>
</td>
<td>
<input type="password" id="txtPassword" name="password"
class="password" tabindex="2" autocomplete="off"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="checkbox" name="rememberMe"
value="rememberMe" tabindex="3"/>
<label for="txtRememberMe">Remember Me</label>
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" value="Sign-in"
class="button" tabindex="3"/>
</td>
</tr>
</table>
</form>
<br/>
<a target="_blank" href="../docs/signin_userguide.html" tabindex="4">
Sign-in Help
</a>
</div>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function init(loginStatus) {
// intialize the code and call to the back end
/*wso2.wsf.Util.initURLs();*/
/*Initialize the XSLT cache*/
/*wso2.wsf.XSLTHelper.init();*/
if (loginStatus == 'true') {
} else if (loginStatus == 'null') {
} else if (loginStatus == 'false') {
wso2.wsf.Util.alertWarning("Login failed. Please recheck the user name and password and try again")
}
}
document.getElementById('txtUserName').focus();
</script>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="footer" colspan="3">
<div id="footer-div">
<div class="footer-content">
<div class="copyright">
© 2005 - 2014 WSO2 Inc. All Rights Reserved.
</div>
<!--div class="poweredby">
</div-->
</div>
</div>
</td>
</tr>
</table>
<script type="text/javascript">
if (Function('/*#cc_on return document.documentMode===10#*/')()){
document.documentElement.className+=' ie10';
}
</script>
</body>
</html>
which is actually the HTML page of wso2 carbon server.
Does wso2 apim support this kind of pattern??

How do I autofill webservice data into input form in AngularJS?

I am trying to autofill input form fields by writing the number and pressing the search button. The data should come from a remote webservice. The goal is that AngularJS ng-model should bind the values and autofill them into the input fields. It doesn't work.
My HTML and JavaScript look like this:
'use strict';
var customerApp = angular.module('customerApp', ['ngRoute']);
customerApp.controller('CustomerUpdateCtrl', ['$scope', '$http', '$location', '$route', '$routeParams',
function($scope, $http, $location, $route, $routeParams) {
$scope.customer = {
cust_no: '',
cust_name: '',
customers: [],
currentCustomer: {}
};
// Update New Customer
$scope.updateNewCustomer = function() {
$http.get('http://office.insoft.net:9091/special_oystein_kunde_get/' + $scope.customer.cust_no).success(function(data) {
$scope.customer.customers = data;
$scope.whichCustomer = $routeParams.customerId;
$location.path("/update");
console.log('Message: ' + $scope.customer.customers);
console.dir($scope.customer.customers);
console.dir(data);
});
}
}
]);
<!DOCTYPE html>
<html ng-app="customerApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Customer</title>
<!-- bootstrap.min.css -->
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<!-- font-awesome.css -->
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" />
<!-- bootstrap-theme.min.css -->
<link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css" />
<!-- foundation.css -->
<link href="http://cdn.foundation5.zurb.com/foundation.css" rel="stylesheet" />
<!-- jquery.min.js -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- jquery-ui.min.js -->
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>
<!-- bootstrap.min.js -->
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- angular.min.js -->
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script>
<!-- angular-route.min.js -->
<script src="https://code.angularjs.org/1.2.27/angular-route.min.js"></script>
<!-- js/app.js -->
<script src="js/app.js"></script>
<!-- js/controllers.js -->
<script src="js/controllers.js"></script>
<!-- directives.js -->
<script src="js/directives.js"></script>
</head>
<body>
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<div class="text-center">
<div class="page-header text-center">
<h1>Rediger kunde</h1>
</div>
<form name="customer-form" novalidate ng-submit="" method="get">
<div>
<label>Customer Number</label>
<input name="cust_no" type="number" ng-model="customers[whichCustomer].cust_no" placeholder="Customer Number..." />
</div>
<div>
<label>Customer Name</label>
<input name="cust_name" type="text" ng-model="customers[whichCustomer].cust_name" placeholder="Customer Name..." />
</div>
<div>
<label>Postal Code</label>
<input name="postplace_id" type="number" ng-model="customers[whichCustomer].postplace_id" placeholder="Postal Code..." />
</div>
<div>
<label>City</label>
<input name="postplace_name" type="text" ng-model="customers[whichCustomer].postplace_name" placeholder="City..." />
</div>
<div>
<label>Phone Number</label>
<input name="cust_telephone" type="tel" ng-model="customers[whichCustomer].cust_telephone" placeholder="Phone Number..." />
</div>
<br>
<div>
<button id="autofillMe" class="btn btn-primary" ng-click="updateNewCustomer()">Update Customer</button>
Save New
</div>
</form>
<br>
</div>
</div>
</div>
</body>
</html>