Search Results

Search found 6517 results on 261 pages for 'localhost'.

Page 225/261 | < Previous Page | 221 222 223 224 225 226 227 228 229 230 231 232  | Next Page >

  • Rails 3, Devise and custom controller action

    - by Johnny Klassy
    routes.rb match 'agencies/stub' => 'agencies#stub', :via => :get resources :agencies Here's the rake routes dump agencies_stub GET /agencies/stub(.:format) {:controller=>"agencies", :action=>"stub"} agencies GET /agencies(.:format) {:action=>"index", :controller=>"agencies"} POST /agencies(.:format) {:action=>"create", :controller=>"agencies"} new_agency GET /agencies/new(.:format) {:action=>"new", :controller=>"agencies"} edit_agency GET /agencies/:id/edit(.:format) {:action=>"edit", :controller=>"agencies"} agency GET /agencies/:id(.:format) {:action=>"show", :controller=>"agencies"} PUT /agencies/:id(.:format) {:action=>"update", :controller=>"agencies"} DELETE /agencies/:id(.:format) {:action=>"destroy", :controller=>"agencies"} Devise is setup to have all agenciesroutes only accessible as admin. The call I'm testing with is http://xyz:12345@localhost:3000/agencies/stub but it doesn't authenticate properly, ie, it doesn't recognize it as admin and throws me back to the Devise login page. The creds are a valid admin account. I'm baffled and have no idea why this is happening. Any insights will be much appreciated.

    Read the article

  • How to read the network file.

    - by ungalnanban
    I'm using Net::FTP for getting a remote hosted file. I want to read the file. I don't want to get the file from the remote host to my host (localhost), but I need to read the file content only. Is there any module to do this? use strict; use warnings; use Data::Dumper; use Net::FTP; my $ftp = Net::FTP->new("192.168.8.20", Debug => 0) or die "Cannot connect to some.host.name: $@"; $ftp->login("root",'root123') or die "Cannot login ", $ftp->message; $ftp->cwd("SUGUMAR") or die "Cannot change working directory ", $ftp->message; $ftp->get("Testing.txt") or die "get failed ", $ftp->message; $ftp->quit; In the above sample program, I get the file from 192.168.8.20. Then I will read the file and do the operation. I don't want to place the file in my local system. I need to read the Testing.txt file content.

    Read the article

  • MySQL Database is Indexed at Apache Solr, How to access it via URL

    - by Wasim
    data-config.xml <dataConfig> <dataSource encoding="UTF-8" type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/somevisits" user="root" password=""/> <document name="somevisits"> <entity name="login" query="select * from login"> <field column="sv_id" name="sv_id" /> <field column="sv_username" name="sv_username" /> </entity> </document> </dataConfig> schema.xml <?xml version="1.0" encoding="UTF-8" ?> <schema name="example" version="1.5"> <fields> <field name="sv_id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> <field name="username" type="string" indexed="true" stored="true" required="true"/> <field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/> <field name="text" type="string" indexed="true" stored="false" multiValued="true"/> </fields> <uniqueKey>sv_id</uniqueKey> <types> <fieldType name="string" class="solr.StrField" sortMissingLast="true" /> <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/> </types> </schema> Solr successfully imported mysql database using full http://[localSolr]:8983/solr/#/collection1/dataimport?command=full-import My question is, how to access that mysql imported database now?

    Read the article

  • ServiceStack razor default page

    - by Tom
    Say I have 2 pages /NotADefault.cshtml /Views/Default.cshtml Question 1. Now I run it, page A always gets called implicitly as start-up default page no matter what I name it. Page B will only be called when I explicitly call localhost/View/Default. How do I make page B (the one in View folder) my default page? Question 2. I also have NotADefaultService.cs and DefaultService.cs. I give each page a Service class at the back. However, when page A is called NotADefaultService.cs never gets called. Only DefaultService.cs gets called when page B is called... My observation is that only the pages in the View folder will get their back-end service class working. Outside of View folder it doesn't work. Combining Q1 and Q2. How do I: Option 1. get the backend service class working under / root outside "View" folder? OR Option 2. appoint /View/Default.schtml as my default at start-up where the service class can be hit?

    Read the article

  • javascript :Object doesn't support this property or method

    - by Kaushik
    In my jsp page, I have in the tag, the following code: <script type="text/javascript" src="<%=request.getContextPath()%>/static/js/common/common.js"></script> <script type="text/javascript"> // Function for Suppressing the JS Error function silentErrorHandler() {return true;} window.onerror=silentErrorHandler; </script> If there is some javascript executing on the jsp page after this, then I guess silentErrorHandler() will have no effect. i.e. the error will still show on page. IS this correct? Because the error is showing and am not sure why. The second part of the question is this: The error is Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; AskTbFXTV5/5.9.1.14019) Timestamp: Fri, 7 Jan 2011 21:26:23 UTC Message: Object doesn't support this property or method Line: 613 Char: 1 Code: 0 URI: http://localhost:9080/Claris/static/js/common/common.js And finally, line 613 states document.captureEvents(Event.MOUSEUP); There is error on IE8. Runs fine on Mozilla and IE7. Any suggestions will be very helpful

    Read the article

  • How to get at JSON in grails 2.0

    - by Mikey
    I am sending myself JSON like so with jQuery: $.ajax ({ type: "POST", url: 'http://localhost:8080/myproject/myController/myAction', dataType: 'json', async: false, //json object to sent to the authentication url data: {"stuff":"yes", "listThing":[1,2,3], "listObjects":[{"one":"thing"},{"two":"thing2"}]}, success: function () { alert("Thanks!"); } }) I send this to a controller and do println params And I know I'm already in trouble... [stuff:yes, listObjects[1][two]:thing2, listObjects[0][one]:thing, listThing[]:[1, 2, 3], action:myAction, controller:myController] I cannot figure out how to get at most of these values... I can get "yes" with params.stuff, but I cant do params.listThing.each{} or params.listObjects.each{} What am I doing wrong? UPDATE: I make the controller do this to try the two suggestions so far: println params println params.stuff println params.list('listObjects') println params.listThing def thisWontWork = JSON.parse(params.listThing) render("omg l2json") look how weird the parameters look at the end of the null pointer exception when I try the answers: [stuff:yes, listObjects[1][two]:thing2, listObjects[0][one]:thing, listThing[]:[1, 2, 3], action:l2json, controller:rateAPI] yes [] null | Error 2012-03-25 22:16:13,950 ["http-bio-8080"-exec-7] ERROR errors.GrailsExceptionResolver - NullPointerException occurred when processing request: [POST] /myproject/myController/myAction - parameters: stuff: yes listObjects[1][two]: thing2 listObjects[0][one]: thing listThing[]: 1 listThing[]: 2 listThing[]: 3 UPDATE 2 I am learning things, but this can't be right: println params['listThing[]'] println params['listObjects[0][one]'] prints [1, 2, 3] thing It seems like this is some part of grails new JSON marshaling. This is somewhat inconvenient for my purposes of hacking around with the values. How would I get all these individual params back into a big groovy object of nested maps and lists? Maybe I am not doing what I want with jQuery?

    Read the article

  • Ajax div can't access address bar variable

    - by Elaine Adams
    Can someone please advise me on how my Ajax div can get an address bar variable. The usual way just doesn't work. My address bar currently looks like this: http://localhost/social3/browse/?locationName=Cambridge Usually, I would use a little php and do this: $searchResult = $_POST['locationName']; echo $searchResult; But because I'm in an Ajax div, I can't seem to get to the variable. Do I need to add some JavaScript wizardry to my Ajax coding? (I have little knowledge of this) My Ajax: <script> window.onload = function () { var everyone = document.getElementById('everyone'), searching = document.getElementById('searching'), searchingSubmit = document.getElementById('searchingSubmit'); everyone.onclick = function() { loadXMLDoc('indexEveryone'); everyone.className = 'filterOptionActive'; searching.className = 'filterOption'; } searching.onclick = function() { loadXMLDoc('indexSearching'); searching.className = 'filterOptionActive'; everyone.className = 'filterOption'; } searchingSubmit.onclick = function() { loadXMLDoc('indexSearchingSubmit'); } function loadXMLDoc(pageName) { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("leftCont").innerHTML=xmlhttp.responseText; } } function get_query(){ var url = location.href; var qs = url.substring(url.indexOf('?') + 1).split('&'); for(var i = 0, result = {}; i < qs.length; i++){ qs[i] = qs[i].split('='); result[qs[i][0]] = decodeURIComponent(qs[i][1]); } return result; } xmlhttp.open("GET","../browse/" + pageName + ".php?user=" + get_query()['user'],true); xmlhttp.send(); } } </script> <!-- ends ajax script -->

    Read the article

  • django test client trouble

    - by Anton Koval'
    I've got a problem... we're writing project using django, and i'm trying to use django.test.client with nose test-framework for tests. Our code is like this: from simplejson import loads from urlparse import urljoin from django.test.client import Client TEST_URL = "http://smakly.localhost:9090/" def test_register(): cln = Client() ref_data = {"email": "[email protected]", "name": "???????", "website": "http://hot.bear.com", "xhr": "true"} print urljoin(TEST_URL, "/accounts/register/") response = loads(cln.post(urljoin(TEST_URL, "/accounts/register/"), ref_data)) print response["message"] and in nose output I catch: Traceback (most recent call last): File "/home/psih/work/svn/smakly/eggs/nose-0.11.1-py2.6.egg/nose/case.py", line 183, in runTest self.test(*self.arg) File "/home/psih/work/svn/smakly/src/smakly.tests/smakly/tests/frontend/test_profile.py", line 25, in test_register response = loads(cln.post(urljoin(TEST_URL, "/accounts/register/"), ref_data)) File "/home/psih/work/svn/smakly/parts/django/django/test/client.py", line 313, in post response = self.request(**r) File "/home/psih/work/svn/smakly/parts/django/django/test/client.py", line 225, in request response = self.handler(environ) File "/home/psih/work/svn/smakly/parts/django/django/test/client.py", line 69, in __call__ response = self.get_response(request) File "/home/psih/work/svn/smakly/parts/django/django/core/handlers/base.py", line 78, in get_response urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF) File "/home/psih/work/svn/smakly/parts/django/django/utils/functional.py", line 273, in __getattr__ return getattr(self._wrapped, name) AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF' My settings.py file does have this attribute. If I get the data from the server with standard urllib2.urllopen().read() it works in the proper way. Any ideas how I can solve this case?

    Read the article

  • URL-Encoded post parameters don't Bind to model

    - by Steven Klein
    I have the following Model namespace ClientAPI.Models { public class Internal { public class ReportRequest { public DateTime StartTime; public DateTime EndTime; public string FileName; public string UserName; public string Password; } } } with the following method: [HttpPost] public HttpResponseMessage GetQuickbooksOFXService(Internal.ReportRequest Request){ return GetQuickbooksOFXService(Request.UserName, Request.Password, Request.StartTime, Request.EndTime, Request.FileName); } My webform looks like this: <form method="POST" action="http://localhost:56772/Internal/GetQuickbooksOFXService" target="_blank"> <input type="text" name="StartTime" value="2013-04-03T00:00:00"> <input type="text" name="EndTime" value="2013-05-04T00:00:00"> <input type="text" name="FileName" value="Export_2013-04-03_to_2013-05-03.qbo"> <input type="text" name="UserName" value="UserName"> <input type="text" name="Password" value="*****"> <input type="submit" value="Submit"></form> My question is: I get into the GetQuickbooksOFXService function but my model has all nulls in it instead something useful. Am I doing something wrong?

    Read the article

  • Discusses some issues related to mvc2.0

    - by hao123
    ???????????????,???????? ??: ???????:1????????2????????3???? ?????????????? ??????:1???????:http://demo.com/admin/News/index 2???????:http://demo.com/s7mmer/News/index 3?????:http://demo.com/News/index ??asp.net mvc1.0???????????,?????,??asp.net mvc2.0???Areas?? ??: ???????,?????????????Admin?areas,??VS?????????????areas????,????????????????? ??????????: 1?????????Areas???? 2??Areas ???????? 3?????,?Areas?????????MyAreaRegistration.cs ????: ?? using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; namespace S7mmer.Web { public class AdminAreaRegistration : AreaRegistration { public override string AreaName { get { return "Admin"; } } public override void RegisterArea(AreaRegistrationContext context) { //?????????? context.MapRoute( "AdminController_default", "Admin/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" }, // Parameter defaults new string[] { "S7mmer.Web.Areas.Admin.Controllers" }//controllers????? ); } } public class S7mmerAreaRegistration : AreaRegistration { public override string AreaName { get { return "S7mmer"; } } public override void RegisterArea(AreaRegistrationContext context) { //?????????? context.MapRoute( "S7mmerController_default", "S7mmer/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" }, // Parameter defaults new string[] { "S7mmer.Web.Areas.S7mmer.Controllers" }//controllers????? ); } } public class WebSiteAreaRegistration : AreaRegistration { public override string AreaName { get { return "WebSite"; } } public override void RegisterArea(AreaRegistrationContext context) { //?????????? context.MapRoute( "WebSiteController_default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" }, // Parameter defaults new string[] { "S7mmer.Web.Areas.WebSite.Controllers" }//controllers????? ); } } } 4??Areas?????Admin????????NewsController.cs 5??NewsController.cs??public ActionResult Index()?????view,??? ???news????index.aspx 6????????Global.asax??,?Application_Start()????AreaRegistration.RegisterAllAreas(); protected void Application_Start() { AreaRegistration.RegisterAllAreas(); // RegisterRoutes(RouteTable.Routes); } ????? http://localhost:1108/admin/News/index,??????????! ??????????????????,???????????????,????

    Read the article

  • Zend, slow load, "waiting for response" for 20-80 seconds on local site

    - by Tony C.
    So I have several sites running under the same zend setup. All of the sites run pretty normally except one. Upon loading or reloading this one site, reguardless of which page your on (excluding the 404 page explanation later...) you get a serious pause before any content begins to download. Using firebugs net panel you can see that the first request which is www.(siteaddress).com.local you see a "waiting for response" bar (purple) that is going for anywhere from 20 to sometimes 80+ seconds and this isn't on a dev site, this is on a local site under localhost. What I've managed to figure out so far is that all the pages do this except my 404 page. The reason the 404 page doesn't succumb to this is because it uses a seperate controller (the error controller) and therefore bypasses much of the controller and functions the other parts of the site use. Using exit statements I've manged to figure out that the problem happens somewhere between my post dispatch and my main (top most) controllers Init function. If i exit in the main controllers init the page loads (then exits instantly, no wait). If i do the same in the pre or post dispatch the page waits the 20-80 seconds then exits. Is there a diagram or explanation somewhere or a way for me to find out what events fire inbetween the post dispatch and the main controllers init function? Or does anyone have any clue what might cause this? Any help would be greatly appreciated...

    Read the article

  • javax.xml.bind.MarshalException

    - by sandeep
    Hi, I am getting javax.xml.bind.MarshalException error. I am sending List from my webservice to the backingbean and I have this error. Here is my code: Backing bean @WebServiceRef(wsdlLocation = "http://localhost:26565/Login_webserviceService/Login_webservice?WSDL") public String login() { System.out.println("Login Phase entered"); int result = 0; List list; List finalList = null; try { Weblogin.LoginWebserviceService service = new Weblogin.LoginWebserviceService(); Weblogin.LoginWebservice port = service.getLoginWebservicePort(); result = port.login(voterID, password); Weblogin.LoginWebservice port1 = service.getLoginWebservicePort(); list = port1.candDetails(1); finalList = list; this.setList(finalList); } catch (Exception e) { e.printStackTrace(); } if (result == 1) return "polling"; else return "login"; } Webservice public List candDetails(int pollEvent) { List resultList = null; List finalList = null; try { if (pollEvent == 1) { resultList = em.createNamedQuery("Cantable.findAll").getResultList(); finalList = resultList; } } catch (Exception e) { e.printStackTrace(); } return resultList; }

    Read the article

  • Post complex types to WebApi Client

    - by BumbleBee
    I am new to WebAPI. I have a MVC project and webApi project both reside under the **same solution**. Also, BLL Class library and DAL class library reside under the same solution. Earlier, my MVC project will talk to the BLL now I am trying to create a WebAPi project which stands in between MVC and BLL. Here is what I have come up with so far : I'm using the HTTPClient to post to a WebApi project. My post method on my controller accepts a single parameter (a model). StatsCriteria criteria = new StatsCriteria(); ...... var client = new HttpClient(); var response = client.PostAsJsonAsync("http://localhost:52765/api/reports", criteria).Result; ....... Here's the signature for my controller in Webapi [HttpPost] public CMAReportVM Reports([FromBody] StatsCriteria criteria) { var cmaReport = Service3.GetCMAReport(criteria.Mlsnums); //Create Map to enable mapping business object to View Model Mapper.CreateMap<CMAReport, CMAReportVM>(); // Maps model to VM model class var cmaVM = Mapper.Map<CMAReport, CMAReportVM>(cmaReport); reutn cmaVM; } // and here's my routing: config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } I am getting the following 405 : Method not allowed. As the WebAPI and MVC project both reside under same sloution I am not sure where/how to host my webapi.

    Read the article

  • How do I make a HTTP POST request to an url from within a c++ dll?

    - by tjorriemorrie
    Hi, there's an open-source application I need to use. It allows you to use a custom dll. Unfortunately, I can't code c++; i don't like it; it don't want to learn it. I do know PHP very well however, thus you can see that I'll rather do my logic within a PHP application. Thus I'm thinking about posting the data from c++/dll to a url on my localhost. (i have my local server set up, that's not the problem). I need to post a large amount of variables (thus a POST and not GET request required). The return value will only be one (int)variable, either 0, 1 or 2. So I need a c++ function that: 1) will post variables to an url. 2) Wait for, and receive the answer. The data type can be in xml, soap, json, whatever, doesn't matter. Is there anyone that can write a little c++ http function for me? pretty please? ;)

    Read the article

  • after assembling jar - No Persistence provider for EntityManager named ....

    - by alabalaa
    im developing a standalone application and it works fine when starting it from my ide(intellij idea), but after creating an uberjar and start the application from it javax.persistence.spi.PersistenceProvider is thrown saying "No Persistence provider for EntityManager named testPU" here is my persistence.xml which is placed under meta-inf directory: <persistence-unit name="testPU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>test.model.Configuration</class> <properties> <property name="hibernate.connection.username" value="root"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.password" value="root"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/> <property name="hibernate.c3p0.timeout" value="300"/> <property name="hibernate.hbm2ddl.auto" value="update"/> </properties> </persistence-unit> and here is how im creating the entity manager factory: emf = Persistence.createEntityManagerFactory("testPU"); im using maven and tried the assembly plug-in with the default configuration fot it, i dont have much experience with assembling jars and i dont know if im missing something, so if u have any ideas ill be glad to hear them

    Read the article

  • Issue selenium code maintenance

    - by Rajasankar
    I want to group the common methods in one file and use it. For example, login to a page using selenium may be used in multiple times. Define that in class A and call it in class B. However, it throws null pointer exception. class A has public void test_Login() throws Exception { try{ selenium.setTimeout("60000"); selenium.open("http://localhost"); selenium.windowFocus(); selenium.windowMaximize(); selenium.windowFocus(); selenium.type("userName", "admin"); selenium.type("password", "admin"); Result=selenium.isElementPresent("//input[@type='image']"); selenium.click("//input[@type='image']"); selenium.waitForPageToLoad(Timeout); } catch(Exception ex) { System.out.println(ex); ex.printStackTrace(); } } with all other java syntax in class B public void test_kk() throws Exception { try { a.test_Login(); } catch(Exception ex) { System.out.println(ex); ex.printStackTrace(); } } with all syntax. When I execute class B, I got this error, java.lang.NullPointerException at A.test_Login(A.java:32) at B.test_kk(savefile.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.j ava:212) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at junit.textui.TestRunner.doRun(TestRunner.java:116) at junit.textui.TestRunner.doRun(TestRunner.java:109) at junit.textui.TestRunner.run(TestRunner.java:77) at B.main(B.java:77) I hope someone must have tried this before. I may miss something here.

    Read the article

  • Sending emails with CodeIgniter in a local XAMPP server

    - by KeyStroke
    Hi, I'm trying to send emails through localhost (XAMPP Windows 1.7.3 installation), but I've been trying for hours with no success. This is the last code I tried: $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => 465, 'smtp_user' => '[email protected]', 'smtp_pass' => 'mypassword', ); $this->load->library('email', $config); $this->email->set_newline("\r\n"); $this->email->from('[email protected]', 'My Name'); $this->email->to('[email protected]'); $this->email->subject('Email Test'); $this->email->message('Testing the email class.'); if($this->email->send()) { echo 'Your email was sent.'; } else { show_error($this->email->print_debugger()); } Whenever I tried to load this the page shows that it's loading but nothing happens. Is there anything I need to setup in my server to insure email delivery? I messed with php.ini and sendmail's config a bit with no luck. And openSSL isn't available in case that matters. Any idea what's wrong?

    Read the article

  • What does this model error says in asp.net mvc?

    - by Pandiya Chendur
    My Html action link takes me to a view where i can see the details.. For Ex:http://localhost:1985/Materials/Details/4 But it shows error, The model item passed into the dictionary is of type 'System.Data.Linq.DataQuery`1[CrMVC.Models.ConstructionRepository+Materials]' but this dictionary requires a model item of type 'CrMVC.Models.ConstructionRepository+Materials'. And my model is... public IQueryable<Materials> GetMaterial(int id) { return from m in db.Materials join Mt in db.MeasurementTypes on m.MeasurementTypeId equals Mt.Id where m.Mat_id == id select new Materials() { Id = Convert.ToInt64(m.Mat_id), Mat_Name = m.Mat_Name, Mes_Name = Mt.Name, }; } public class Materials { private Int64 id; public string mat_Name; public string mes_Name; public Int64 Id { get { return id; } set { id = value; } } public string Mat_Name { get { return mat_Name; } set { mat_Name = value; } } public string Mes_Name { get { return mes_Name; } set { mes_Name = value; } } } } and my controller method... public ActionResult Details(int id) { var material = consRepository.GetMaterial(id).AsQueryable(); return View("Details", material); } Any suggestion what am i missing here?

    Read the article

  • Jython & Mysql - what is the current practice for connection?

    - by Sector7B
    Just trying jython for the first time, because something came up at work that would fit for this perfect for it. I assume jython can make mysql jdbc connection using the mysql jdbc driver. After googling and reading, however I am having problems and it seems jython specific and probably simple. so i do jython: Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54) [Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_17 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> print sys.path ['', '/JYTHONPATH/mysql-connector-java-5.1.10-bin.jar', '/WorkArea/Apps/jython/jython2.5.1/Lib', '__classpath__', '__pyclasspath__/', '/WorkArea/Apps/jython/jython2.5.1/Lib/site-packages'] >>> code i'm running from java.lang import * from java.sql import * driverName="com.mysql.jdbc.Driver" Class.forName(driverName) url = "jdbc:mysql://localhost/test?user=jgreenaw&password=" con = DriverManager.getConnection(url) stmt = con.createStatement() output riux:Desktop$ jython pymysql.py Traceback (most recent call last): File "pymysql.py", line 7, in <module> Class.forName(driverName) at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:315) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) at java.lang.ClassLoader.loadClass(ClassLoader.java:250) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) 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:597) java.lang.ClassNotFoundException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver any advice? thanks

    Read the article

  • Django tutorial says I haven't set DATABASE_ENGINE setting yet... but I have

    - by Joe
    I'm working through the Django tutorial and receiving the following error when I run the initial python manage.py syncdb: Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 362 in execute_manager utility.execute() File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 303, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv self.execute(*args, **options.__dict__) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 222, in execute output = self.handle(*args, **options) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 351, in handle return self.handle_noargs(**options) File "/Library/Python/2.6/site-packages/django/core/management/commands/syncdb.py", line 49, in handle_noargs cursor = connection.cursor() File "/Library/Python/2.6/site-packages/django/db/backends/dummy/base.py", line 15, in complain raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet." django.core.exceptions.ImproperlyConfigured: You haven't set the DATABASE_ENGINE setting yet. My settings.py looks like: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'dj_tut', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } } I'm guessing this is something simple, but why isn't it seeing the ENGINE setting?

    Read the article

  • Beginner PHP: I can't insert data into MYSQL database

    - by Victor
    I'm learning PHP right now and I'm trying to insert data into a MySQL database called "pumpl2" The table is set up like this. create table product ( productid int unsigned not null auto_increment primary key, price int(9) not null, value int(9) not null, description text ); I have a form and want to insert the fields from the form in the database. Here is what the php file looks like. <?php // create short variable names $price = $_POST['price']; $value = $_POST['value']; $description = $_POST['description']; if (!$price || !$value || !$description) { echo "You have not entered all the required details.<br />" ."Please go back and try again."; exit; } @ $db = new mysqli('localhost', 'pumpl', '********', 'pumpl2'); if (mysqli_connect_errno()) { echo "Error: Could not connect to database. Please try again later."; exit; } $query = "insert into pumpl2 values ('".$price."', '".$value."', '".$description."')"; $result = $db->query($query); if ($result) { echo $db->affected_rows." product inserted into database."; } else { echo "An error has occurred. The item was not added."; } $db->close(); ?> When I submit the form, I get an error message "An error has occurred. The item was not added." Does anyone know what the problem is? Thank you!

    Read the article

  • Tilting web browser on windows phone 7

    - by marcus
    Hi guys, i'm working on a windows phone 7 emulator. I have a web browser which navigates to local host. So my problem i faced was that when i tilt the windows phone 7 emulator 90% right, the screen doesn't. Could there be any advice on how to do so? using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls; namespace DSP { public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); } private void ContentPanel_Loaded(object sender, RoutedEventArgs e) { MessageBox.Show("Loading website. This might take a few seconds..."); webBrowser1.Navigate(new Uri("http://localhost/Liweiyi_fyp_082648y/homepage.html", UriKind.Absolute)); } private void webBrowser1_Loaded(object sender, RoutedEventArgs e) { } } }

    Read the article

  • Rails: Added new Action in Controller, but there is no path?

    - by Newbie
    Hello! I try to do following: A user is on his profile page. Now he edits his profile. He klicks on update and the data is saved. Now I want to redirect the user to another kind of profile-edit-page. I did the following in my users_controller.rb: def update @user = User.find(params[:id]) respond_to do |format| if @user.update_attributes(params[:user]) flash[:notice] = 'User was successfully updated.' if(@user.team_id != nil) format.html { redirect_to(@user) } else format.html { redirect_to choose_team_path } end format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end end end def choose_team @user = User.find(params[:id]) end I created a view: /users/choose_team.html.erb Now I get the following error: undefined local variable or method `choose_team_path' for #<UsersController:0x1f56650> So I added choose_team to my routes.rb: map.choose_team 'choose-team', :controller => 'users', :action => 'choose_team' Now, after submitting my first edit form, it redirects me to http://localhost:3000/choose-team and I get following error: Couldn't find User without an ID What I want: If a user has no team_id, he should be redirected to my choose_team.html.erb for choosing a team, else he should be redirected to his profile/show. How to do this?

    Read the article

  • before filter not working as expected

    - by Jimmy
    Hey guys I have a ruby on rails app with a before filter setup in my application controller to ensure only the owner can edit a document, but my permission check is always failing even when it shouldn't. Here is the code: def get_logged_in_user id = session[:user_id] unless id.nil? @current_user = User.find(id) end end def require_login get_logged_in_user if @current_user.nil? session[:original_uri] = request.request_uri flash[:notice] = "You must login first." redirect_to login end end def check_current_user_permission require_login logger.debug "user id is #{params[:user_id]}" logger.debug "current user id is #{session[:user_id]}" if session[:user_id] != params[:user_id] flash[:notice] = "You don't have permission to do that." redirect_to :controller => 'home' end end The code to note is in the check_current_user_permission. Here is an example of my log output: user id is 3 current user id is 3 Redirected to http://localhost:3000/home Filter chain halted as [:check_current_user_permission] rendered_or_redirected. Can anyone shed some light into why this is failing? Obviously the user_id of 3 is equal to the session's user_id of 3. What is going wrong?

    Read the article

  • Implimenting Zend MVC for my existing site-first step?

    - by Joel
    Hi guys, OK-newbie question here. I'll try not to bombard SO with lots of questions-and hopefully this first one will show me the method I'll need to follow for subsequent conversions. I have a web-based calendar system that I developed, but it was coded for me procedurally (using PHP). I'm now working on learning OO and wanting to integrate this site into my localhost Zend Framework and slowly start converting parts to OO and the Zend Framework MVC process in particular. As I've said before, I understand that this will be a slow process, and when I'm done, I still probably won't have anything as OO friendly as if I had rewritten it from scratch, but I'd like to use this as a learning experience. So, I have dropped the whole site into my localhose/zend/Public folder, and everything is showing up great and linking to the database, etc. My question is-what would be the easiest first component to switch over to the MVC model? This site has a bit of everything-forms, login, authentication, some jQuery, etc. Can anyone point to a tutorial that would address what I'm trying to do? If indeed, a form would be one of the simpler things to switch, can someone walk me through those changes? Another idea is changing over all the header info, etc? Thanks for any pointers on where to start! EDIT: Also, I understand that SO is mainly for specific coding questions-I'm happy to share specific code, once I have an idea about which section to tackle first...

    Read the article

< Previous Page | 221 222 223 224 225 226 227 228 229 230 231 232  | Next Page >