am developing a spring mvc web application. in WEB-INF/context.xml am not mensioning any path.then how to get the context path into the jsp. If i have path="/abc" in context.xml then in jsp
Member 10263519
Posts
-
get the context path in jsp -
comparing two dates in javascripti want to compare dates . startjourney=moment(moment($('#onDate').val()).format("DD/MM/YYYY")+' '+ $('#starttime').val(),"DD/MM/YYYY h:mm A");//concate date and time am getting 27/01/2016 12:00 AM newDate=moment(startjourney).add(mapDuration[0],'days').add(mapDuration[2],'hours').add(mapDuration[4],'minutes').format("DD/MM/YYYY hh:mm A");//29/01/2016 10:17 AM // returnJourneyDate=newDate.split(" ")[0]; // // endTime=moment(newDate.split(" ")[1]+ ' '+newDate.split(" ")[2],"h:mm A "); // selectedTime=moment($('#starttime').val(),"h:mm A"); alert(moment($('#returntime').val(),"HH:MM").toDate()); selectedjourney=moment($('#returndate').val()+' '+ moment($('#returntime').val(),"HH:MM")).toDate();//concate date and time as strings selectedDate=moment(selectedjourney,"DD/MM/YYYY h:mm A").toDate(); var date=new Date(selectedjourney,"DD/MM/YYYY hh:mm tt"); var d=moment( $('#returntime').val(),"HH:MM").toDate(); var h=new Date(selectedDate); if(selectedjourney.isBefore(newDate))// test selected one is before newDate bootbox.alert( "Return journey time must be after " + newDate);
-
getting last inserted rowi want the query plz help
-
getting last inserted rowHi, we r developing visitor tracking system,when avisitor come giving a card and he swips and enters inside ,when he releaving handovers the card to watchmen.after that there is a chance same card can be given to someother visitor. mysql table is not having primary key. table is like this: cardid name intime outtime -------------------------------------------- 123 raj 1/2/2014 10:12 1/2/2014 11:00 234 rajee 1/2/2014 10:34 123 vani 1/2/2014 12:10 then here how can i get the last inserted row of id(123) to update the outtime am using c# following code:
String intime = "";
String outtime = "";String indatetime=System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); String outdatetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); using (MySqlConnection con = new MySqlConnection(ConnectionString)) { String query = "select \* from visitor where card\_id=@id ORDER BY card\_id DESC LIMIT 1"; MySqlCommand command = new MySqlCommand(query, con); command.Parameters.AddWithValue("@id", txtAddVisitorCardId.Text); con.Open(); using (MySqlDataReader rdr = command.ExecuteReader()) { if (rdr.Read()) { intime = rdr\["in\_time"\].ToString(); outtime = rdr\["out\_time"\].ToString(); } } } if (((intime == "") && (outtime == "")) || ((intime!="")&&(outtime !=""))) { using (MySqlConnection con = new MySqlConnection(ConnectionString)) { String query = "insert into visitor(card\_id,name,age,address,id\_proof,contact\_person,purpose,in\_time) values(@id,@name,@age,@address,@idproof,@contact,@purpose,@in)"; MySqlCommand command = new MySqlCommand(query, con); command.Parameters.AddWithValue("@id", txtAddVisitorCardId.Text); command.Parameters.AddWithValue("@name", txtAddVisitorName.Text); command.Parameters.AddWithValue("@age", txtAddVisitorAge.Text); command.Parameters.AddWithValue("@address", txtAddVisitorAddress.Text);
-
selecting data from two tablesam generating EXcel/ PDF file,in .net application written by me,
-
selecting data from two tablesMysql database we are using.yes my transaction table is having two records per customer id, but paid amounts and other fields are different , but here the query is giving last record values for two records having same customerid. Transaction table doesn't contain primary key,so there exists more than one record per customer id. and i want most recent record from Database.
-
selecting data from two tableshi, I need to select data from two tables am using the following query:
select c.customer_id ,c.father_name ,c.address,c.phone_number ,c.mobile_number ,c.id_proof ,c.area ,c.ip_address as 'IP Address',c.mac_address as 'MAC Address',c.package_type as 'Package Type',c.name as Name,c.activation_date as 'Activation Date',c.status as 'Status',c.installation_cost as 'Installation Cost',c.totalamount_paid as 'Total Amount Paid',c.monthly_amount as 'Monthly Amount',c.lastpaid_date as 'Last Paid Date',c.lastpaid_amount as 'Last Paid Amount',c.nextpay_date as 'Next Pay Date',c.totaldue_amount as 'Total Due Amount',t.agent_id as 'Agent ID',t.token_number as 'Token Number',t.machine_id as 'Machine ID' from customer c,transaction t where c.customer_id=t.customer_id and DATE(t.paid_date)BETWEEN '2014-02-02'AND '2014-04-02' ;
It's giving correct information but each record is displayed twice , i want a record only once.
-
get day wise records seperated by idhi, am using query as Select machine_id as MachineID,item_name as Name,SUM(item_quantity) as Quantity,SUM(billed_amount) as BilledAmount,SUM(received_amount) as ReceivedAmount from transaction where DATE(paid_date)='" + rdate + "'Group by machine_id,item_name here rdate , am collecting from UI, string rdate = dateTimePicker1.Value.ToString("yyyy-MM-dd"); MachineID Name Quantity BilledAmount ReceivedAmount V0001 petrol 61 244 244 V0002 Diesel 186 726 726 V0002 petrol 155 605 605 Total 402 1575 1575 But i want for every machine id ,total row V0001 - - - - total - - - V0001 - - - - total - - -
-
query for monthly reportthanks
-
query for monthly reporthi, i need to get data from database on monthly basis.i need to select month from UI, based on that , i want the records in database. am using Mysql database in c#, any suggestions
-
datetime problemit's ok, but how to add milliseconds. actually, in c# am using DateTimePicker control.this will give only (year-month-date hour:minutes:seconds) it doesn't support milliseconds. so , Is there any way to get the data stored in database as it is.(24 hour format)
-
datetime problemHi, am developing application in .net,c#. am saving datetime value as: yyyy-MM-ss HH:mm:ss (24 hour format) after saving in database i observed in database , it's stored in specified format . and here the problem is: when i retrieve data , datetime is coming as 12 hour format. what to do........
-
How to get last 3 values from Mysql tableNot only one record. there exist duplicates(Means no primary key) get the last inserted 3 records for the same id
-
How to get last 3 values from Mysql tablehi, am adding new record for every transaction,then how to get the last 3 transaction values.
-
stored procedures in mysqlhow can i test whether it's working or not in workbench. am testing in query as: execute getpassword 'stl123'; but it's giving errors. and in my c# code is:
MySqlCommand command = new MySqlCommand("getpassword", con);
command.CommandType = System.Data.CommandType.StoredProcedure;
command.Parameters.AddWithValue("@member", txtuser.Text);
con.Open();
using (MySqlDataReader rdr = command.ExecuteReader())
{
if (rdr.Read())
{reader object rdr is showing no rows.
-
stored procedures in mysqlthanq , how can i test in workbench, whether in query, or at stored procedures
-
stored procedures in mysqlHow to test it in workbench, whether it's working or not.
-
stored procedures in mysqlam executing it in workbench, am i right. still am getting error at @
-
stored procedures in mysqlhi, am not getting what's wrong in this procedure: create procedure getpassword( in member varchar(20)) begin select password from admin where member_id = member end am getting error at "end" syntax error unexpected end,expecting ;
-
get the property name of custom folderHow to get the custom folder location in c3 winforms setup . am creating setup for my project, i added a custom folder named as ABC, default location:tempdir\UPLOAD property:hi so the folder(UPLOAD)is created in programfiles\companyname\manufacturer how to get the location of that folder in c# program.